I solved my P0171 issue by replacing the PCV hose. Try that first. It's not expensive and easy to do. It also solved my floating rpm (not the hanging one), meaning, when you rev the engine to 2.5k, it stays there for a second or two until it goes down.... to a hanging rpm where it stays at 1.5k, then another second or two to go down to regular idle.