fixed read_random_array_idx not working as intended ( calling an undef f...

Hi ! 
I fixed read_random_array_idx,  it seems that wasn't working as intended.  
list:nth should be lists:nth  and NewKey was returning an array as a key, it was enough to use just the key retrieved in the 1st line of the function.