Fix and test use case when a template extends a template that extends an other template.