Fix bug with closing tabs in OSX