Added support for custom TemplateManager.