Patches to new_mrb_format

There seems a few non-standard code, redundant code, and signedness mismatches.
They are not obvious bugs.