Windows 8 fix by @adrianmaurer