fixed a bug with delegated templates with variants - templates with the same name can be in different files