Fix handling of event