Minor fix to rand().