Various tweaks and fix vim performance issue