some fixes to silence cl.exe compiler warnings on windows

Do not merge.