Templating fixes