Fix bug where goToPane would not clean up panes properly