Another fix for windows crash with FOREACH_PARAM, it was still accessing an
element beyond the end of the vector which could crash.