P0171 refers to the fuel trim system being lean. Possible causes could be water in the fuel, too much alcohol in the fuel, a clogged fuel injector and/or a weak fuel pump.
P1516 refers to a fault in the Throttle Actuator Control (TAC) Module or with the Throttle Actuator Position Performance. Possible causes include Poor connections at the PCM or at the component.
For a better explanation of them codes, including testing and repair, click here.
A also found 3 tsb's on that code P0171 that confirms the possible causes. They are here, here and here.
The first tsb, talks about the fuel injector connectors are crossed or incorrectly installed.
If they haven't been worked on lately, I would just ignore this one.
The second tsb discusses the Use of fuel containing greater than 10% ethanol in non-E85 designated vehicles can cause driveability issues.
The third, about clogged injectors.
What I would do is first of all if you can remember if the problem started right after the last time you got gas and you remember where the gas station was or have a receipt, check out the labeling on the pump and see if it is U85.
Second, I would run both some cleaner and dry gas through the tank and get rid of any water that may be in there and also try to clean those fuel injectors.
You may even want to drain about 1 pint of gas out of the tank into a clear glass jar and let it sit for about 1/2 hour and settle. Then if you start to see a distinct line of separation between gas and water, the gas has got water in it. Can't remember though which will be on top but I assume since oil floats on the ocean after a spill, then the gas would be on top, so then the line would be near the bottom
Then, I would check the fuel pump pressure and make sure it is 50-57 psi.
Actually I see in that one tsb they mention fuel injector cleaning and using a certain cleaner.
I found 2 tsb's on code P1516, click here and here.
The first tsb explains that the code may have set under a low battery voltage condition during or prior to vehicle cranking, then starting.
The second, says that a repeat DTC P1516 may be caused by an internal concern with the PCM.
An inspection of the PCM serial number year and Julian (PCM build) date will be necessary to determine if the PCM will need to be replaced to correct the repeat DTC P1516.