Minor changes in the error handling.