Rob..
The two Bill's are here for you on P0171.
Check/replace and or seal the EGR to LIM tube. Typically it cracks over time and no testing will find the leak.
Check all other vacuum and TB gasket etc.
Clean maf sensor
Ensure fuel pressure is good
Check battery cables for any corrsion
That'll start you off.