Fixing some exceptions when no tabs are open