Fix autoport detection on Windows 7