fixes #1646, #3103 - enable cloning and locking of templates