Add error handling for fields defined in data but not in code