Make sure ref_idc value is in right range