More null pointer dereference fixes