add test for flattening metadata values