Change how error messages are formatted
Add some unit tests to try to track down bug.