Fixed invalid assumption in shuffle_array.