WARNING: This page is about a different car, the 2012 Subaru Forester. However, it is still accessible from the selected car via links, so may be relevant.
Make sure that the engine ground terminal has no contamination, corrosion or looseness and is properly connected to the engine.