Replace some explicit Iterator uses with foreach.