Fixes tests, random number generation