fixing bugs in test