Toyota Repair: engine light, mass air flow meter, mass air flow


Question
it's a 2000 ls400 with a 4.0 liter
-------------------------------------------
The text above is a follow-up to ...

-----Question-----
after filling my ls400 up with gas yesterday engine started
running rough and engine light came on when i got home i checked the codes an got P0171 thought maybe it was just bad gas so i cleared the codes and was just going to drive it till i ran some gas out to fill it again but today the VSC light came on as well any thoughts?
-----Answer-----
The P0171 code is a fuel system lean condition, the fuel/air mixture is too lean, what year is it and what engine does it have, the VSC light will turn on because of the check engine light, when the check eng lite comes on the VSC system is disabled and turns the light on to warn the driver that there is no VSC until the engine light condition is corrected.

Answer
Is the engine still running rough at this time, does it have a rrough idle?misfire? If so the cause for the misfire needs to be determined, it may be as simple as a bad spark plug, an engine misfire will cause a lean condition but it would also show a misfire code, you said there is only the 171 code, if the engine is running without misfires and is smooth running then I would recommend replacing the mass air flow meter located in the intake tube,at the same time the throttle body should be cleaned, if the engine is otherwise in good condition this should solve the problem.