Changed handling of events.