fix header cell grouping
fix various tmpl problems