Fix problem with closing from the command line when there are multiple tabs