correction of some bugs in unit tests.