Fix because rand was unknown on osx