Fix compile errors when building with MSVCPP