Fixed dumb null pointer bug