Add some features to error handling.