Fix program crashes when closing