Canceling running tasks

I noticed that running tasks are not being canceled, since the head check at base.cancel is `if (this.state == 2) return;` 
I think it was supposed to be `if (this.state =! 2) return;` or even something that may also cancel idle tasks.
My change is working, would please consider merging if I am right?