Fix another bug in autoindent (and add a test)