Implement rand-int and rand-nth