Improving error handling.