Being so intermittent, it's the starter. This is becoming very common on these engines.
Check your engine ground cable. If that's in good shape, then your starter solenoid is most than likely pooched.
http://www.m3post.com/forums/showthr...hlight=starter
http://www.m3post.com/forums/showthr...hlight=starter
The terminal 50 code in CAS could simply be popping up because it sees an issue after sending a signal to terminal 50 (starter solenoid) but the starter is not engaging.