Added support for exporting instantiated templates