Fixes bug with template

Fixes #42