Update to use residual and clear tool when trace removed