fixes to make tests pass; thx unittests