Fix randomizer function.