Workarounds for jruby ffi issue