fix deprecation warnings in Ruby 2.1