More accurate error handling, add failing test for structured data