Fixed NullReferenceExceptions when running the Unit Tests from Visual Studio.