some fixes for the metadata mapping