Various improvements to logging/imports