Rework error handling.