Fixed a template bug