Fix logging in tests