Fixed merge of templates branch