Cleanup and tracing.