Further refinements to error handling.