Minor fixes to templates