Corrected some potential NPEs