Fixed bug that caused program not to exit on Linux when closing it.