Fix the support for charref