Fixing file deletion issues