[Lackman] Removed debugging output.
[Lackman] Properly handle closing tabs, fixes #1789.

Refs #1784.
[Lackman] Better code.