Logging and cleanups.