Misc improvements in logging, documentation etc.