Looks to me like the IDC connector has been butchered and another wire (yellow) has been used in its place. It might look ugly, but it looks like it was a "running repair"..
I don't see the "loose" wire - looks to be three wires soldered, and a diode in circuit.
I'd be looking at the circuit to see if the Spinner diode is wired correctly. I know you replaced it, but it might have been around the wrong way to start with ?