Sometimes when I drive my 2001 Accent in stop-n-go traffic, the car will make a thunk sound (transmission noise) on deceleration and just before a full stop. After, this happens the acceleration is jerky and the CEL comes on. Also when the traffic frees up, I notice the car is stuck in a low gear and the engine revs high (4000 rpm). I turn the car off. The next time I use the car, things are back to normal and the CEL goes off. What is going on?