Fix bugs in the TestCase

Fix bugs and make sure the TestCase is OK