Changed the loop counter to use size_t.