Test the TPS: http://www.4crawler.com/4x4/CheapTricks/TPS/index.shtml

And it is the O2 sensor that tells the ECU the amount of oxygen left in the exhaust and that is how it adjusts the air/fuel ratio. So if the O2 sensor is giving bad data back to the ECU. it could be getting the mixture wrong.