Why did my headlights kill my car?

So, I had a really wierd situation as I was putting my Duster back together. It wouldn't start unless the headlights were on. I could shut them off after it was started and it would stay running but, wouldn't shut off unless I turned the headlights off. It wound up being the ground for the headlight curciut. Its in the harness under the battery tray there are 4 or 5 ground wires that clamp together into one main ground that i believe goes to the headlight switch if I remember correctly. Either way it was all corroded where the wires came together under the battery. When chasing this stuff start simple. Start by turning on the headlights, unplug the plug at the headlight and check for voltage with a test light, only one side should have power with the lo beams on then, 2 should have power with the hi beams on. If you have power at all 3 wires then you have a bad ground in the circuit. From there just open the harness and follow it back to find where the problem is coming from. Good luck!! Electrical things can drive ya crazy but, keep it simple..power and grounds is all it needs...don't over complicate it.