Fix handling some UI events