Merge pull request #194 from csmith/master

Use forEach where possible.
Minor tidying.