Code style: for -> foreach where eligible.