The fan motor comes on when the ground loop is completed by the pin closing in the thermoswitch. Although rare, it sometimes sticks in the closed position causing the fan to run. Most of the time they stick open and the fan won't come on.
That's a good idea dan, if you unplug it and it still runs then there is a wire shorted out, if it quits running it's the thermo switch, now why didn't I think of that.