Added support for template_vars being an array of dicts