Fixed incorrect byte count when writing XML entity references