Fixed a bug in test cases