Bugfixes; improvements; logging fixes.