All possible NullReferenceExceptions removed