Upgrade to Ruby 2.1 and fix an intermittently failing test

Upgrade to Ruby 2.1 and fix an intermittently failing test. 

I want to update, improve and expand the tests too.