More logging and cleanup