Fix exit code if window creation fails