Help car is not working right

I have a 2000 toyota celica gt auto with a Cold Air Intake and recently it wants to hesitate and wont go, have a hard time starting sometimes, but after i get on highway works almost ok. The cel light in on and getting p0171 and po300 but i changed all the plugs and 1 of the ignition coil. I am about to clean the filter and clean the maf but i dont know wat else could be the problem. No leaks i can hear or see.