Use correct indexes for loop.
Merge pull request #3528 from ktf/fix-indexes

DQM -- Use correct indexes for loop.