fixed bugs in test.