more null pointer fixes