Add local index variable to loop

Was taking a look at the project -- noticed Travis wasn't green. Seemed like an easy fix!