Fixed console instant close bug.