Fix error with closed clients and swaping focus.