Improved handling of TaskTracker cleanup.