Fix autoadvance through loops