[Issue 272] Write support for metadata