more templating fixes