Fixes to template files