Fixed some templating issues