Fix bug in new templating