More fixes for error message handling.