fixed bug in MetadataQuery pattern hierarchy