fix a bunch of autocommand issues