Fix handling of duff JSON