Debugged null pointer error.