fixed minor avoiding NPEs in corner cases