Trace/Log changes and minor tidying up