trying to figure out how to get rid of the memory leak.
Do some refactoring wrt, change semantics of failure/cancels, rewrite tests to take these changes into account.