Fix setPane over an existing pane

Fixes setting a pane over an existing pane. Previously the inner pane would be removed and there would be nowhere to add the new pane.