compile with MSVC, fix bug introduced by C++ code