Adapt destruct_tab_node()
Rewrite tab node removal function
Fix flatten_tab()