Fix logging related code