IIRC the engine loom earths via the two brown cables connected to the throttle cable bracket.
There is then an earth strap from one of the bellhousing bolts back to the battery, or maybe the battery tray.
First thing to check is that's still intact.
Pull the cover off the ECU plug and check the condition of those 2 earths on pins 1 and 19, ive seen these melted before.