Fixed a bug where closing a tab would close the whole window.