Fix 'vector subscription out of range' MSVC assertions