Fix error handling.
Rename result_set to results.
Add a TODO comment.