Index: trunk/psModules/src/objects/pmSourceIO_CMF.c.in
===================================================================
--- trunk/psModules/src/objects/pmSourceIO_CMF.c.in	(revision 36756)
+++ trunk/psModules/src/objects/pmSourceIO_CMF.c.in	(revision 36758)
@@ -1475,10 +1475,14 @@
         for (int iModel = 0; iModel < source->modelFits->n; iModel++) {
             pmModel *model = source->modelFits->data[iModel];
-            pmSourceGalaxyFits *galaxyFits = source->galaxyFits->data[iModel];
-
-            if (!model || !galaxyFits) return false;
-
-            // XXX: TODO: we should search for the model that has the same type as the fits
-            psAssert(model->type == galaxyFits->modelType, "galaxyFits model type does not match model type");
+            if (!model) continue;
+
+            pmSourceGalaxyFits *galaxyFits = NULL;
+            for (int iFit = 0; iFit < source->galaxyFits->n; iFit++) {
+                galaxyFits = source->galaxyFits->data[iFit];
+                if (model->type == galaxyFits->modelType) break;
+                galaxyFits = NULL;
+            }
+
+            if (!galaxyFits) continue;
 
             // X,Y coordinates are stored with the model parameters
