Fixed crash on Win8 (Thanks to @skrebbel for reporting it)