Rearrange command: small bug fix