Remove some debug code and make sure we don't jump past the end when there are no plugin settings panes.