I've been getting the P0171 codes for some time now where it comes and goes, especially in the winter. I was never able to pinpoint exactly what the problem was, but it recently came back. I got it checked at AZ today and they said I have the same codes as you and they also recommend a MAF sensor replacement. But before I go spending the $220 it costs for a new MAF did the air fuel sensor fix your problem?