Improved structured error message. Fixes #44