Fixed build errors under MSVC and x64.