add (and fix) tests for metadata