I do not see a lot of bad batteries with Subaru. I do see a lot of cars that sit and only get started and run on occasion which can discharge and weaken a battery. Particularly before they are sold. I would assume it is the battery, a weak battery can cause a pcm to act nuts.