Fixed match template issues