rnd updated so the array picks use length -1 (fixes #541)