More improvements/fixes for logging