Various changes with handling window events.