Make all loop variables in model method unique.

This was committed while testing a problem that manifested only on the production server.