Fixed bug with random seeding