Fixed task cancellation handling