avoid setting invalid total byte count.