Please update with these two pull requests

only tested on emacs24