Fixed a number of bugs and NullReferenceExceptions in the single player mode