Cleanup of TaskDispatcher