Added autocmd Write, cleanup