Fixes scan agent task deletion.
Merge commit 'e6e9f9daa30b33a418a3cce95d9ad958e8489d67' into HEAD