Proper error handling.

A thoroughly history of this can be found in #25.