Trying to fix error handling.