Fixed rand and changed the random seed on unix machines