Fix more possible NPEs