fix for more-than "64000" entity expansions in this document bug