Fixed NullPtr problem.