Changes to be able to delete staged downloads

Could you take a look Ivan? I'm a little rusty on this and don't want to be introducing a bug at this stage of things.