Remove terms from flat tree when adding a new one