Fix up issue with encoding of entities.