Fix random tests