Turn "fields" into a proper object.