Fix "for" loop logic in move()