Fixed bugs in tests.