Fix some logging issue