bug fix in test cases and new test cases as per Johns comments