Several logging improvements