Refactoring some loops to fast enumeration.
Merge pull request #879 from OliverLetterer/loops-loops-loops

Refactoring some loops to fast enumeration.