Index: trunk/ppstamp/src/ppstamp.c
===================================================================
--- trunk/ppstamp/src/ppstamp.c	(revision 15280)
+++ trunk/ppstamp/src/ppstamp.c	(revision 15363)
@@ -7,15 +7,10 @@
 int main(int argc, char **argv)
 {
-    ppstampOptions *options;
+    ppstampOptions *options = NULL;
+    int exitCode;
 
     psTimerStart(TIMERNAME);
-
     psLibInit(NULL);
-
-    // Parse the configuration and arguments
-    // Open the input image(s)
-    // note usage is called on error or request by ppstampArguments
-    // TODO is the cleanup really necessary since we're exiting anyways?
-    // (It's useful to know about memory leaks)
+    ppstampErrorRegister();
 
     pmConfig *config = ppstampArguments(argc, argv, &options);
@@ -26,5 +21,4 @@
     }
 
-    // define recipe options
     // define the active I/O files
     if (!ppstampParseCamera(config)) {
@@ -35,6 +29,8 @@
 
     // find the pixels that we need to copy, setup the output image
-    if (!ppstampMakeStamp(config, options)) {
-        exit(PS_EXIT_UNKNOWN_ERROR);
+    if (ppstampMakeStamp(config, options)) {
+        exitCode = 0;
+    } else {
+        exitCode = PS_EXIT_DATA_ERROR;
     }
 
@@ -44,4 +40,4 @@
     ppstampCleanup(config, options);
 
-    return PS_EXIT_SUCCESS;
+    return exitCode;
 }
