Fixes several crash issues with the latest VIm versions

Implement crash solution given in Google group:
https://groups.google.com/forum/#!topic/vim_dev/HgKdV33Jy5I