There is a post about that code in the general 2nd generation section. Something to do with a timing chain/cover gasket. Sorry about the poor explanation but just bought my 07 so not familiar with a lot of stuff yet.
P0171 is a lean condition code in I believe Bank 1. Could be a vacuum leak. Yiu can tell if you have a scanner that can display live data. I use an App called Torque Pro with my Android phone and Tablet. You can look at the short term fuel data and see how much gas is being added to the bank.