more changes to support MSVC build