Fixes #1177
Set the state to CANCEL instead of RESUME
Delay the removal of the resource at the very end
Fixes #1192
Fixes #1145