Added randomized test case generation.