Fixes to templates