Add TemplateFile spec
Fix type-conversion error in TemplateFile