Fixes scan agent task deletion.