More fixes for terminal mode