backport from trunk (rev #9818)

fixed missing return for Cancels already matched from script