Fix bug in template file