Made _has_template_branches() and _add_template_branches() private.