Workaround for JRuby

Little fix for JRuby compatibility.