Fix two possible NPEs