Fixed SDL event handling