Fixed CANCEL to wait when no callback is provided

And added a test case.