On my car with the same symptoms it turned out my original firewall to block ground wire was bad. The connections at both ends were clean and tight and the wire tested good for continuity. Ground wire from battery to block was new and both connections clean and tight. Replaced firewall ground and problem solved. It drove me nuts.