Fix crash on launch in the window code.