Correct a wrong calculation done by the encode_size routine