Happy days that was an easy fix, why can't previous owners bolt things together correctly though!!
You are very lucky with a loose main earth cable that you didn't fry your engine loom and ecu, as having seen this before it tries to use the ecu earth points to power up starter.
tabetha