Fix #1266
Merge pull request #1281 from ppasq/templates

Fix #1266