Fix bug in metadata/id when provided id is a string field name