Fix test case defects