some fixes for MSVC