Fixed a exception handling bug (caused by the switch to JRuby 1.7.x?)