fixed bugs in test error