Test case update and bug fix