I bought this car about three months ago with 180K on it and tested for codes after taking for drive test with no problems. I drove it for about 200 miles after purchase no problems except not so great mpg as i was expecting ( 24-25 mpg mixed city and hwy ) so i decided to do some basic tune up and replaced spark plugs, air filter and cleaned MAF sensor then after about 350 miles driven since purchased, engine light came on code was P1346, I replaced the Camshaft position sensor, did oil change, cleaned VVT solenoid finally replaced Timing chain tensioner and that code didn't come back but now i get code P0171. I tried to reset the computer by disconnecting the battery but the code came back after 600 miles. The car runs fine for its age except bad smell with cold starts and sometimes if car idling outside i can smell it around and not so great mpg. I cleaned the MAF sensor again yesterday but i can still smell that nasty smell at cold starts or with idling. Last time the code P0171 was triggered i did a scan and took pictures for freeze frame Fuel trims and it showed short fuel trim 19.% & Long fuel trim 18.0% which are high readings right? Please advice of what is happening. Do you think it is a bad MAF or leak? I will attach the images for freeze frame data. Thank you in advance.