regression fixes from unit tests