Fix a typo in cancel flag handling