If you're having trouble with your P0171, check out the link in my signature.

And to the op, that's amazing that it was the BOV. People run aftermarket VTA BOV's and don't throw that code. Glad you got it fixed!