Minor event handling bugfix