Fixed bug that produced seg-fault when closing main window.