Ruby 2.1 and small bug fixes