More fixes for event handling