Index: trunk/psLib/src/dataIO/psFits.c
===================================================================
--- trunk/psLib/src/dataIO/psFits.c	(revision 3039)
+++ trunk/psLib/src/dataIO/psFits.c	(revision 3108)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-18 20:01:48 $
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-02 20:22:56 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -1069,7 +1069,7 @@
     //transverse the metadata list and add each key.
 
-    psListIterator* iter = psListIteratorAlloc(header->list,PS_LIST_HEAD);
+    psListIterator* iter = psListIteratorAlloc(header->list,PS_LIST_HEAD,true);
     psMetadataItem* item;
-    while ( (item=psListGetNext(iter)) != NULL ) {
+    while ( (item=psListGetAndIncrement(iter)) != NULL ) {
         if (item->type == PS_META_PRIMITIVE) { // we only write primitive data types.
             switch (item->pType) {
@@ -1485,6 +1485,6 @@
         if (rowMeta != NULL) {
             psListIterator* iter = psListIteratorAlloc(rowMeta->list,
-                                   PS_LIST_HEAD);
-            while ( (item=psListGetNext(iter)) != NULL) {
+                                   PS_LIST_HEAD,true);
+            while ( (item=psListGetAndIncrement(iter)) != NULL) {
                 if (item->type == PS_META_PRIMITIVE) {
                     bool found = false;
