Modify to support MSVC compiler