Fix previous NullPointerException, but added strange test for null elsewhere