Improved behavior when deleting files