fix issues on Windows host and some problems on 24.1 emacs