Fixed an MSVC specific runtime error only in debug mode