Cleaning up error handling.