More fixes for error handling.