fix MSVC warning and error