Tidy up autocmd calls.
Add a few more tests.