Add code to make autoswap work on Windows.