Fix another autoindent bug and add a test for it