I found out that your PCM may go haywire due to a bad battery. Even with the battery changeout, the issues with the PCM remains. You will either have to try to reset the pcm to clear out the bad data created from the bad battery or have it reflashed.
Happened to me when my battery died. Limping home trying to keep the truck from dying. After replacing the battery, the truck still will not hold idle and stutters, it will stutter and die. Luckily my PCM is custom programmed, I took out my tuner and reprogrammed it. Idle/stutter issues gone.