Minor bug and logging fixes.