WIN32 compilation
fixes for win64 compilation.