Tweak to loop index grabbing.