Fixed build problems on JRuby and Rbx.