Index: trunk/ippdb/tests/alloc.c
===================================================================
--- trunk/ippdb/tests/alloc.c	(revision 11027)
+++ trunk/ippdb/tests/alloc.c	(revision 11030)
@@ -608,5 +608,5 @@
         p2PendingExpRow *object;
 
-        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string", -16    );
+        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string"    );
 
         if (!object) {
@@ -634,7 +634,4 @@
             exit(EXIT_FAILURE);
         }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
 
         psFree(object);
@@ -644,5 +641,5 @@
         p2PendingImfileRow *object;
 
-        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32, -16    );
+        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32    );
 
         if (!object) {
@@ -674,7 +671,4 @@
             exit(EXIT_FAILURE);
         }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
 
         psFree(object);
@@ -730,5 +724,5 @@
         p2ProcessedImfileRow *object;
 
-        object = p2ProcessedImfileRowAlloc("a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32    );
+        object = p2ProcessedImfileRowAlloc("a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32, -16    );
 
         if (!object) {
@@ -777,4 +771,7 @@
         }
         if (!object->p2_version == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
             psFree(object);
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/insert.c
===================================================================
--- trunk/ippdb/tests/insert.c	(revision 11027)
+++ trunk/ippdb/tests/insert.c	(revision 11030)
@@ -208,20 +208,20 @@
         }
 
-        if (!p2PendingExpInsert(dbh, "a string", "a string", -32, -32, "a string", -16)) {
-            exit(EXIT_FAILURE);
-        }
-
-        psDBCleanup(dbh);
-    }
-
-    {
-        psDB            *dbh;
-
-        dbh = psDBInit("localhost", "test", NULL, "test");
-        if (!dbh) {
-            exit(EXIT_FAILURE);
-        }
-
-        if (!p2PendingImfileInsert(dbh, "a string", "a string", "a string", "a string", -32, -32, -16)) {
+        if (!p2PendingExpInsert(dbh, "a string", "a string", -32, -32, "a string")) {
+            exit(EXIT_FAILURE);
+        }
+
+        psDBCleanup(dbh);
+    }
+
+    {
+        psDB            *dbh;
+
+        dbh = psDBInit("localhost", "test", NULL, "test");
+        if (!dbh) {
+            exit(EXIT_FAILURE);
+        }
+
+        if (!p2PendingImfileInsert(dbh, "a string", "a string", "a string", "a string", -32, -32)) {
             exit(EXIT_FAILURE);
         }
@@ -268,5 +268,5 @@
         }
 
-        if (!p2ProcessedImfileInsert(dbh, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32)) {
+        if (!p2ProcessedImfileInsert(dbh, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32, -16)) {
             exit(EXIT_FAILURE);
         }
Index: trunk/ippdb/tests/insertobject.c
===================================================================
--- trunk/ippdb/tests/insertobject.c	(revision 11027)
+++ trunk/ippdb/tests/insertobject.c	(revision 11030)
@@ -300,5 +300,5 @@
         }
 
-        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string", -16);
+        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -322,5 +322,5 @@
         }
 
-        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32, -16);
+        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32);
         if (!object) {
             exit(EXIT_FAILURE);
@@ -388,5 +388,5 @@
         }
 
-        object = p2ProcessedImfileRowAlloc("a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32);
+        object = p2ProcessedImfileRowAlloc("a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32, -16);
         if (!object) {
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/metadatafromobject.c
===================================================================
--- trunk/ippdb/tests/metadatafromobject.c	(revision 11027)
+++ trunk/ippdb/tests/metadatafromobject.c	(revision 11030)
@@ -714,5 +714,5 @@
         bool            status;
 
-        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string", -16);
+        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string");
         if (!object) {
             exit(EXIT_FAILURE);
@@ -746,7 +746,4 @@
             exit(EXIT_FAILURE);
         }
-            psFree(md);
-            exit(EXIT_FAILURE);
-        }
 
         psFree(md);
@@ -758,5 +755,5 @@
         bool            status;
 
-        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32, -16);
+        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32);
         if (!object) {
             exit(EXIT_FAILURE);
@@ -794,7 +791,4 @@
             exit(EXIT_FAILURE);
         }
-            psFree(md);
-            exit(EXIT_FAILURE);
-        }
 
         psFree(md);
@@ -868,5 +862,5 @@
         bool            status;
 
-        object = p2ProcessedImfileRowAlloc("a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32);
+        object = p2ProcessedImfileRowAlloc("a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32, -16);
         if (!object) {
             exit(EXIT_FAILURE);
@@ -921,4 +915,7 @@
         }
         if (!psMetadataLookupS32(&status, md, "p2_version") == -32) {
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
             psFree(md);
             exit(EXIT_FAILURE);
Index: trunk/ippdb/tests/objectfrommetadata.c
===================================================================
--- trunk/ippdb/tests/objectfrommetadata.c	(revision 11027)
+++ trunk/ippdb/tests/objectfrommetadata.c	(revision 11030)
@@ -1123,7 +1123,4 @@
             exit(EXIT_FAILURE);
         }
-            psFree(md);
-            exit(EXIT_FAILURE);
-        }
 
         object = p2PendingExpObjectFromMetadata(md);
@@ -1155,7 +1152,4 @@
             exit(EXIT_FAILURE);
         }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
 
         psFree(object);
@@ -1191,7 +1185,4 @@
             exit(EXIT_FAILURE);
         }
-            psFree(md);
-            exit(EXIT_FAILURE);
-        }
 
         object = p2PendingImfileObjectFromMetadata(md);
@@ -1227,7 +1218,4 @@
             exit(EXIT_FAILURE);
         }
-            psFree(object);
-            exit(EXIT_FAILURE);
-        }
 
         psFree(object);
@@ -1359,4 +1347,7 @@
             exit(EXIT_FAILURE);
         }
+            psFree(md);
+            exit(EXIT_FAILURE);
+        }
 
         object = p2ProcessedImfileObjectFromMetadata(md);
@@ -1409,4 +1400,7 @@
         }
         if (!object->p2_version == -32) {
+            psFree(object);
+            exit(EXIT_FAILURE);
+        }
             psFree(object);
             exit(EXIT_FAILURE);
