I'll bet it is the O2 sensor. i just replaced mine Wednesday for that exact reason. On a side note, the almost stalling after first take off in the morning has stopped. So pray for warranty, or expect to pay $140 for the part and that much in labor if you let a dealer do it.
Blue Focus Owners