Fixed a bug with randomize_array