Preventing NullReference Exceptions.