Fixed bug in XML entity counter