Added more basis for error handling.