Handling exceptions properly.