Revert use of herror() (it is deprecated)