Fixed template to correctly deal with wildcards