bug fixes in metadata mapping