Add autoindent, fix insert bug