C++ win32 fixes

A couple of fixes to make the C++ code compile on Windows using the Visual Studio compiler.