Fixed minor bug in TemplateController