fixed problems found in unit tests