fixed bugs in test cases