bugfix. minor refactoring. add a test for metadata transfer. (currently failing)
provide more detailed diagnosis
fix the test, add FIXME.