fixed further bugs in unit tests