metadat tool bug fix and enhancement