Replaced template_path_stack with template_map