Improve Cancel detection.