fix on RidBag, did not work properly when RID_BAG_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD was set to high value (bigger than a short)