Fix tmpl file permissions mess