Fix compilation errors
It is perfectly valid to set a pointer to NULL multiple times, albeit weird, so we probably shouldn't crash on it