Some tweaks, fix performance issue with ruby syntax in insert mode