Another fix to support unicode in the template substitution.