fix metadata, add tests