Fix compilation errors on MSVC
Fix compilation errors on clang