Redo error code to not use error().  Improve error messages.
Fixes issue 1.