Fix logging