Fix crash on switching to Window Mode

Woo!