fix some more nil checks