Fixed random test bug