use proper for() loops instead of std::for_each + a lambda where appropriate
Merge remote-tracking branch 'github/master'