Fixed crashes when calling unregistered events