Fix fd limits and error handling of delete.