Added support for multiple templates with same name