Another fix for cancellation logic + tests