Fixing bugs from the previous commits relating to lastSeen not being discarded properly and tab selection errors