more null pointer cleanup