Fix failing test "TemplateRepository of tag is retained by the sole template"