Fixed bizarre null pointer exception