fix parsing of metadata