Fix tests to allow use of random, but not change each time