Fixes for JRuby