Fix https://github.com/rec/bashrc-and-emacs/issues/3 and https://github.com/rec/bashrc-and-emacs/issues/5