Some small mods to 'template' task, plus small fixes.