Detailed error

Fixes #836