more fixes according to unit tests