various jruby compatibility fixes