fix last metadata piece size calculation