I will throw out two secnerios here. First one is far fetched, the other more practical.
1) What sort of battery did you replace it with? Are you sure the battery is properly rated for your vehicle?
Reason I ask... If you install a battery that is not properly rated for our vehicle, it can cause all sorts of strange electrical gremilans to rear there ugly little heads.
In this case, it "MIGHT" be possible that the battery you installed was not the properly rated battery and it cause a problem in the TFT Sensor (Transmission Fluid Temp Sensor). This sensor monitors the temp of the tranny fluid and with this input, in turn, controls the amount of pressure output from the pump to the valve body. If the PCM thought the tranny was colder then it really was, it would have shot a large amount of fluid through to the valve body. Since the tranny was not as cold as the PCM thought it was, there would have been a sort of overflow because of the excessive pressure.
2) On top on the valve body cover (looks like a normal tranny pan), which is located just under the battery. There is a vent tube that extrudes out of this pan. It would be possible that you accidently kinked, in some way, the tube. This tube basically vents excess pressure out of the tranny, during operations like I mentioned in the above example. If this tube was kinked, the air had nowhere to go and since it had to go back out through the otherside of the tranny, it would make since that it would blow some tranny fluid out with it. It would also have an effect of shifting since internal pressures would be extremlly high.