fix compatibility with rubinius and jruby