on_close wasn’t used correctly everywhere. Also make the "close" commands for each tab specific to themselves, rather than taking the current tab for closure.