Fix unsafe warning on MSVC