more fixes to templates