Fix logging issues