emacs: fixed a few bugs.