Make a few more loop tweaks.

I missed these in the first pass because some of them are in header
files, and the others iterated using an int rather than unsigned or
size_t.