Fixing another null pointer bug