fix tests and mocks