Added template name resolution.