Index: /trunk/ppStats/src/ppStats.c
===================================================================
--- /trunk/ppStats/src/ppStats.c	(revision 13657)
+++ /trunk/ppStats/src/ppStats.c	(revision 13658)
@@ -12,11 +12,25 @@
                     pmFPA *fpa,         // FPA for which to get statistics
                     pmFPAview *view,    // View for analysis
+                    psMaskType maskVal, // Value to mask
                     pmConfig *config    // Configuration
     )
 {
-    psExit status;
+    PS_ASSERT_PTR_NON_NULL(fpa, NULL)
+    PS_ASSERT_PTR_NON_NULL(view, NULL);
+    PS_ASSERT_PTR_NON_NULL(config, NULL);
+
+    ppStatsData *data = ppStatsDataAlloc(); // All the input data
 
     // Get the options, open the files
-    ppStatsData *data = ppStatsSetupFromRecipe(NULL, config);
+    if (!ppStatsSetupFromRecipe(data, config)) {
+        psError(PS_ERR_UNKNOWN, false, "Unable to get ppStats options from recipe.");
+        psFree(data);
+        return NULL;
+    }
+
+    // Override recipe mask value if one is provided
+    if (maskVal != 0) {
+        data->maskVal = maskVal;
+    }
 
     if (data->fpa) {
@@ -31,10 +45,11 @@
 
     // Go through the FPA and do the hard work
+    psExit status;                      // Status of statistics loop
     psMetadata *result = ppStatsLoop(&status, out, data, config);
     if (status != PS_EXIT_SUCCESS) {
-	psError (PS_ERR_UNKNOWN, false, "trouble getting stats\n");
+        psError (PS_ERR_UNKNOWN, false, "Not able to measure FPA statistics.\n");
         psFree(result);
-	psFree(data);
-	return (NULL);
+        psFree(data);
+        return (NULL);
     }
 
Index: /trunk/ppStats/src/ppStats.h
===================================================================
--- /trunk/ppStats/src/ppStats.h	(revision 13657)
+++ /trunk/ppStats/src/ppStats.h	(revision 13658)
@@ -15,4 +15,5 @@
                     pmFPA *fpa,         // FPA for which to get statistics
                     pmFPAview *view,    // View for analysis
+                    psMaskType maskVal, // Value to mask
                     pmConfig *config    // Configuration
     );
Index: /trunk/ppStats/src/ppStatsSetupFromArgs.c
===================================================================
--- /trunk/ppStats/src/ppStatsSetupFromArgs.c	(revision 13657)
+++ /trunk/ppStats/src/ppStatsSetupFromArgs.c	(revision 13658)
@@ -191,5 +191,9 @@
 
     // Get the rest from the recipe
-    ppStatsSetupFromRecipe(data, config);
+    if (!ppStatsSetupFromRecipe(data, config)) {
+        psError(PS_ERR_UNKNOWN, false, "Unable to read ppStats options from recipe.");
+        psFree(data);
+        return NULL;
+    }
 
     // Print out what we're going to do
Index: /trunk/ppStats/src/ppStatsSetupFromRecipe.c
===================================================================
--- /trunk/ppStats/src/ppStatsSetupFromRecipe.c	(revision 13657)
+++ /trunk/ppStats/src/ppStatsSetupFromRecipe.c	(revision 13658)
@@ -14,5 +14,5 @@
 // Strings in a recipe may be defined multiply (with MULTI) or listed on a single line
 static void listFromRecipe(psList *target, // The target list
-			   const psMetadata *recipe, // Recipe to search
+                           const psMetadata *recipe, // Recipe to search
                            const char *name // Name for item within recipe
     )
@@ -65,11 +65,10 @@
 
 
-ppStatsData *ppStatsSetupFromRecipe(ppStatsData *data, // Data for running ppStats
-                                    pmConfig *config // Configuration
+bool ppStatsSetupFromRecipe(ppStatsData *data, // Data for running ppStats
+                            pmConfig *config // Configuration
     )
 {
-    if (!data) {
-        data = ppStatsDataAlloc();
-    }
+    PS_ASSERT_PTR_NON_NULL(data, false);
+    PS_ASSERT_PTR_NON_NULL(config, false);
 
     // Determine recipe parameters
Index: /trunk/ppStats/src/ppStatsSetupFromRecipe.h
===================================================================
--- /trunk/ppStats/src/ppStatsSetupFromRecipe.h	(revision 13657)
+++ /trunk/ppStats/src/ppStatsSetupFromRecipe.h	(revision 13658)
@@ -5,6 +5,6 @@
 #include "ppStatsData.h"
 
-ppStatsData *ppStatsSetupFromRecipe(ppStatsData *data, // Data for running ppStats
-                                    pmConfig *config // Configuration
+bool ppStatsSetupFromRecipe(ppStatsData *data, // Data for running ppStats
+                            pmConfig *config // Configuration
     );
 
Index: /trunk/ppStats/src/ppStatsStandAlone.c
===================================================================
--- /trunk/ppStats/src/ppStatsStandAlone.c	(revision 13657)
+++ /trunk/ppStats/src/ppStatsStandAlone.c	(revision 13658)
@@ -61,9 +61,9 @@
     if (status != PS_EXIT_SUCCESS) {
         psErrorStackPrint(stderr, "Error in stats loop.\n");
-	exit (status);
+        exit (status);
     }
     if (psListLength(results->list) == 0) {
         psErrorStackPrint(stderr, "No output.\n");
-	exit (status);
+        exit (status);
     }
 
