Toyota Repair: O2 Sensor cleaning messed up my 4Runner, air fuel ratio, toyota 4runner


Question
I have a 1999 Toyota 4Runner Limited 4x4 auto w/ 3.4 liter engine 170,000 mi.
Check engine light came on and has been on for a couple months. Still ran just fine but figured I should attend to it. O'Reilly's code checker said "P0171 too lean bank 1". The clerk suggested the O2 Sensor. I Googled and found a Toyota 4x4 forum that suggested taking it out and soaking it in gas for 4-5 hours, blasting w/ brake cleaner and replacing. The one O2 I removed was in front of the cat. Disconnected the battery, reconnected and started the engine.
The engine now runs like crap. Remember it was running fine before I messed with it... The idle circuit is fine but any opening of the throttle it stumbles all over itself, even some exhaust backfire.
I now know that there are four O2's scattered around the engine. It's not practical to start replacing parts without a plan, especially with up to $200 per part.

I swapped the rear O2, after the cat to the front position as suggested by a parts rep at the Toyota dealer, with the same results. Still stumbles. The only thing I touched during this entire fiasco was the forward O2 and the battery, what the heck did I screw up? Right now it is un-drivable.

The auto parts industry has about 5 or 6 theoretical various O2's that say they will work with this Toyota. Very confusing on the actual one that is correct for this 4Runner. How do I tell if I indeed have a Calif emissions truck?

Not sure what I should do, don't really have the $ to visit the dealer for a $1000+ goof up.

I was planning to clean the MAP sensor in the a.m. and swap the O2's back to their original locations.

I can supply part #'s if you need them... and can answer any questions you might have...

Any suggestions?
Thank you for your help.

Thanks,
Jeff

Answer
The front and rear O2 sensors are not interchangeable they have different functions so put the rear one back and replace the front one which is actually an air fuel ratio sensor. The P0171 is usually caused by a dirty mass aiflow sensor (MAF)remove the sensor and clean the sensor wires inside the opening of the sensor, use only electronic parts cleaner in a spray can, give this a try and let me know what happens, by the way some of the cheap O2 sensors have to be wired in so try to stay away from those and get one that just plugs in.