Fix behavior of closing tab.

close #63