fixes #1646 - enable cloning of templates

Split this in a couple of lines please, it'd be easier to read without scrolling :smile: