Fixed bug with context menu not closing when switching tabs. (Issue #28)