Fix rare null pointer