Bug fix in test code