hmmm.. check the wiring on the 02 sensor, make sure all looks fine... particularly in the plug
code 51... when you did the diagnostics did you have the a/c on?
if you didn't
then code 51 is also TPS
which if out of adjustment could throw the check engine light i guess.... never experienced tps problems personally
try resetting the ecu (pull main and efi fuse for 30 secs) then plug back in (make sure your ignition isn't on at the time heh) go for another run and see what happens.. obviously don't boot it as we're problem diagnosing