Fix templating issues