More logging, minor bug fixes.