fixing bugs in tests