Properly invalidate stats on cancel; add test coverage.