Fixes for Ruby 2