Removed some debugging junk and fixed a null pointer exception.