More error checking and rational reporting.
This relates to issue #3.