Bug fix to template file