Fixed Emacs crashes, magit works too.