Fix for issue #34 : the wrong tab is made active when closing the active one in a notebook.