A number of major modifications, for using with Emacs 24.4