Fixed broken random generator