Unable to clear engine code

I'm working on an 89 mustang and it is giving me code 51 ( ECT is\was too high) but I can't get it cleared. I have left the battery off for a long enough time to clear the computer but the CEL stays on. there is an aftermarket temp gauge hooked could that be causing a problem.

Any suggestions?
 
The ECT is a sensor on the passenger side of the motor.
The sender for the gauge is on the drivers side of the lower intake. This sender has one wire and is only for the gauge.

Check the signal wire for the ECT. If it reads the same as the input, check continuity between the two wires, as they may have shorted together.