Output variables come first
Add comment for fr_canonicalize_error
Convert tmpl_afrom_attr_substr to use a similar signature as other parsing functions