Fix examples.rb

There were errors in some of the foreach loops, this also makes them consistent.