Fixes from Peder to make emacs in a terminal behave better (key and colorwise)