Fixed bug in CRuby 1.8.7 and some versions of JRuby (namely 1.8) and REE