Trying to solve NullReferenceExceptions.