Fix crash on tab switch.
Fix handler connections.