Fixed logging mocks and tests