Fixed reworking of templates