Fixed a rearrangement/shuffle bug