Small changes in error handling.