Cleanup in the tracing method.