I've had a very comparable problem to this recently. The check engine light had been coming on but the car has run okay. When it started to idle rough and sometime stall when I came to a stop I took it to a local dealer for a diagnosis of the check engine light. They told me that it was the mass air flow sensor and they could fix it (including the 70 bucks to diagnose the problem) for a mere $371. I changed myself for about $70 but it didn't fix the problem.