Needs conditioned on json != NULL, I think; max and min are just assigned to existing list entries otherwise.