Rewrite add_roots_for()
Make depth a signed value
Remove old unused static function
Adapt destruct_tab_node()
Rewrite tab node removal function
Fix flatten_tab()