Fix some incompatibilities with Emacs 24.1.1