Made mroe code portable to MSVC