Simplify and fix for-of

Merged username-removed-506044 requested to merge (removed):fix-for-of into master