Added some better handling of older versions of emacs.