fixed bugs in tests