Fix a crash in Win8