Some logging improvements