Refactor error messaging.

#77