Use unsigned integer as iterator variable

Fixes gcc warning