diff --git a/metatype/src/main/java/org/apache/felix/metatype/MetaData.java b/metatype/src/main/java/org/apache/felix/metatype/MetaData.java
index e7d69d4..9abf244 100644
--- a/metatype/src/main/java/org/apache/felix/metatype/MetaData.java
+++ b/metatype/src/main/java/org/apache/felix/metatype/MetaData.java
@@ -87,7 +87,14 @@
                 designates = new HashMap();
             }
 
-            designates.put( designate.getPid(), designate );
+            if ( designate.getFactoryPid() != null )
+            {
+                designates.put( designate.getFactoryPid(), designate );
+            }
+            else
+            {
+                designates.put( designate.getPid(), designate );
+            }
         }
     }
 
diff --git a/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java b/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java
index b3ce2b6..482529d 100644
--- a/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java
+++ b/metatype/src/main/java/org/apache/felix/metatype/MetaDataReader.java
@@ -84,7 +84,7 @@
     private final Set DESIGNATEOBJECT_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { "ocdref" }));
     private final Set METADATA_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { "localization" }));
     private final Set OCD_ATTRIBUTES = new HashSet(Arrays.asList(new String[] { "name", "description", "id" }));
-    
+
 
     /**
      * Parses the XML document provided by the <code>url</code>. The XML document
@@ -196,7 +196,7 @@
         return mti;
     }
 
-    
+
     private void readOptionalAttributes(OptionalAttributes entity, Set attributes) {
         int count = this.parser.getAttributeCount();
         for (int i = 0; i < count; i++)
@@ -209,13 +209,13 @@
             }
         }
     }
-    
+
 
     private MetaData readMetaData() throws IOException, XmlPullParserException
     {
         MetaData mti = this.createMetaData();
         mti.setLocalePrefix( this.getOptionalAttribute( "localization" ) );
-        
+
         readOptionalAttributes(mti, METADATA_ATTRIBUTES);
 
         int eventType = this.parser.next();
@@ -258,7 +258,7 @@
         ocd.setId( this.getRequiredAttribute( "id" ) );
         ocd.setName( this.getRequiredAttribute( "name" ) );
         ocd.setDescription( this.getOptionalAttribute( "description" ) );
-        
+
         readOptionalAttributes(ocd, OCD_ATTRIBUTES);
 
         int eventType = this.parser.next();
@@ -310,13 +310,20 @@
 
     private Designate readDesignate() throws IOException, XmlPullParserException
     {
+        final String pid = this.getOptionalAttribute( "pid" );
+        final String factoryPid = this.getOptionalAttribute( "factoryPid" );
+        if ( pid == null && factoryPid == null )
+        {
+            missingAttribute( "pid or factoryPid" );
+        }
+
         Designate designate = this.createDesignate();
-        designate.setPid( this.getRequiredAttribute( "pid" ) );
-        designate.setFactoryPid( this.getOptionalAttribute( "factoryPid" ) );
+        designate.setPid( pid );
+        designate.setFactoryPid( factoryPid );
         designate.setBundleLocation( this.getOptionalAttribute( "bundle" ) );
         designate.setOptional( this.getOptionalAttribute( "optional", false ) );
         designate.setMerge( this.getOptionalAttribute( "merge", false ) );
-        
+
         readOptionalAttributes(designate, DESIGNATE_ATTRIBUTES);
 
         int eventType = this.parser.next();
@@ -363,7 +370,7 @@
         ad.setRequired( this.getOptionalAttribute( "required", true ) );
 
         readOptionalAttributes(ad, AD_ATTRIBUTES);
-        
+
         Map options = new LinkedHashMap();
         int eventType = this.parser.next();
         while ( eventType != XmlPullParser.END_DOCUMENT )
@@ -405,7 +412,7 @@
     {
         DesignateObject oh = this.createDesignateObject();
         oh.setOcdRef( this.getRequiredAttribute( "ocdref" ) );
-        
+
         readOptionalAttributes(oh, DESIGNATEOBJECT_ATTRIBUTES);
 
         int eventType = this.parser.next();
diff --git a/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeInformationImpl.java b/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeInformationImpl.java
index f1fd44c..dbf3772 100644
--- a/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeInformationImpl.java
+++ b/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeInformationImpl.java
@@ -179,15 +179,17 @@
                     continue;
                 }
 
-                // gather pids and factory pids
-                if (designate.getFactoryPid() != null) {
+                // gather pids and factory pids and register provider
+                if ( designate.getFactoryPid() != null )
+                {
                     this.factoryPids.add( designate.getFactoryPid() );
-                } else {
-                    this.pids.add(designate.getPid());
+                    this.addMetaTypeProvider( designate.getFactoryPid(), dmtp );
                 }
-
-                // register a metatype provider for the pid
-                this.addMetaTypeProvider(designate.getPid(), dmtp);
+                else
+                {
+                    this.pids.add( designate.getPid() );
+                    this.addMetaTypeProvider( designate.getPid(), dmtp );
+                }
             }
         }
     }
