code 31
Air Flow Meter Signal
(7M-GE)
Open circuit in VC signal or short circuit between VS and E2 when idle contacts are closed.
(7M-GTE)
Open or short circuit in air flow meter signal.
Air flow meter circuit
Air flow meter
ECU
http://cygnusx1.net/supra/library/TSRM/fi/FI_038.html
code 51
Switch condition signal
No "IDL" signal, "NSW" signal or "A/C" signal to ECU, during diagnosis check.
Check to to make sure you were in Park or neutral when doing the diagnostic and also check to make sure a/c wasn't switched on when doing the diagnostic
try another air flow meter
and you haven't said if you have fixed your grounds