Fixed the way settings are retrieved for templates.