Fix permute_rows.