Fix tests and edge conditions for events.