Better error handling and a check for empty trash.