Fixed errors that occur in terminal mode