Fix bug in test utils and test case