fix wrong last piece size behavior in piece manager
update main