Fix registerevents