Fix index issues in json deserialization.