fix deprecation warnings on ruby 2.1