Patch to support MSVC better, contributed by Morten Ofstad