Changing from FIXNUM_P to get JRuby to work (NO IDEA WHY!!!); also lots of little tweaks