I bet you are on a good track checking connections and grounds. How about the ignition switch itself and also the alternator, brushes, and regulator? Since several symptoms seem to occur together or randomly the main voltage may be off or not reliably getting to parts like fuel pump relay or primary ignition. Engine controller failures are extremely rare, probably only due to some kind of electrical abuse if even then. Codes might get triggered by a component which isn't really bad if the voltage regulation is off. The problem with the fan might be a good starting point - if power is not getting there you may be able to trace all the way back to primary connections to find something open or corroded.
|