Modified to to (re)support (kind of) Windows 8