fix some bugs, remove MSVC stuff