bugs in tests fixed