Updated for compatibility with Emacs 24.3.