P0171 is usually a vacuum leak or a cracked EGR pipe (if it's not deleted).