fixed some templating issues