P0171 code was fixed by removing and basic cleaning of fuel injectors. However it took several months and other 'remedies' to finally bring me to discover my 'fix' of the P0171 code on my 2005 Pontiac Vibe - base, 192,000 miles. These other 'remedies' may have helped in fixing the p0171 code but cleaning the fuel injectors is what finally turned off the CEL on the dash. Ten months of trying to figure out the fix and replacing MAF, Intake Manifold gasket, Throttle body screen /gasket, O2 sensor(s), replacing spark plugs, fuel pump and filter(of inside gas tank fuel assemblage) and cleaning the whole gas /fuel system with Seafoam, all may have helped the vehicle but still vehicle had problems with idle and starting problems by the ten month period. I was ready to give up when one more research of code P0171 pointed to 'fuel injectors' specifically... and not MAF or intake gasket. So I took out the injectors and discovered they were all dirty so I did a quick clean wipe of them and put them back in. After driving around the car and a few cycles of operation, the code was gone! I'm ordering some new fuel injectors ( Denso 23250-0D050) to replace the old, 190,000 miles, used ones. Hope this helps others with same problem. Good luck!
BTW- Fuel Pump (w/filter sock included in kit) # Denso 950-0202 ; Fuel Pump Regulator # Denso 23280-21010 . Parts #'s are from my original parts off my 2005 Pontiac Vibe, 1.8L, base (... which also could be the Toyota Maxrix).