Make sure to clean the bore, that's where the problem usually is, as the crud builds up it effectively closes the throttle which lowers the idle speed. The computer (PCM) compensates for it but when the battery goes dead or you disconnect it the adaptive strategy is lost.