Removed some code that was causing issues when multiple tabs are closed via Ctrl-w shortcut. Hopefully working now or at least better.
Added a tab counter in the window title as it was difficult to tell if a new tab had actually been opened when middle ckicking links.