some tidy up and tweaking of debug logs.