Fix bug where removed sections kept reference to old parent