Fix more errors related to terminal mode.