Fix performance of the mandarin template.