Correct error handling.
Fix ui.