Fix the 'for loop' snippet missing index bug.