Small bug fix for the rearrange command