Some improvements to the templates.