I thought of something else because you mentioned your battery was dead. This usually resets the saved shift points in the TCM so the car has to 'learn' to shift again. It will shift 'funny' until the shift points are re-learned. If your car ever goes into the 'limp home' mode usually clears shift points too. Google for 'learning transmission shift points' for info. Maybe you didn't need a new TCM. If you have been running the battery dead that could be the cause of the transmission shifting funny. If battery is removed for 30 minutes, the shift points are erased. Good luck, Chicklet.
RE: 97 Cherokee transmission service