Fixed building the templates