minor tweaks to logging. Needs better heuristics