fixes for dereferencing null pointer