Fixed a bug when using @ref syntax to reference a template defined in a
multi-root configuration