Drivability after Timing belt change....

My 96 Escort 1.9 is running a bit erratic at idle after changing the timing belt yesterday. Also changed thermostat(had separated inside of housing),
hoses, water pump, serpentine belt and serp pulley. All my marks lined up for install of timing belt. It ran very rough after firing it up the first time so I disasembled and check the marks again. It seems to run good after warm up. However, it died a couple of times today while in drive(warm) at stop(after dirving about 40 miles). It will rev by itself 5 or 6 times in succession then idle up to about 1200 rpm then drop down to 750 rpm and remain steady. It seems to only do it upon cold start and when I put it in park after driving for a while. I am wondering if it is trying to learn itself again. The battery was unplugged during the work. Does the KAM(Keep Alive Memory) take long to relearn?
Thanks in advance.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
What are the chances of the Throttle Position Sensor going out at the same time I changed timing belt. Got to looking at a book from the library and realized what it could be. unplugged it and it idled fine. The part was only 13.00 US. Its right back at a steady 750 rpm. Still learning about cars with all these electronics. I am thinking about a code scanner. Any recommendations for a reasonably priced scanners with good features?

timing
first
after
in
KAM(Keep
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Motorsforum.com is a website by car enthusiasts for car enthusiasts. It is not affiliated with any of the car or spare part manufacturers or car dealers discussed here. All logos and trade names are the property of their respective owners.