Fixed a bug where onFailure is not called when cancel() is used.