Corrected errors in function: pick_random_sn