Stylistic cleanup.

Also make some loops use size_t to eliminate some casting