Make a few more range-based loops use explicit types.

No functional change.