Init random generator before calling rand()