bug fix in test code