Index: trunk/ppStack/src/ppStackConvolve.c
===================================================================
--- trunk/ppStack/src/ppStackConvolve.c	(revision 30394)
+++ trunk/ppStack/src/ppStackConvolve.c	(revision 30620)
@@ -1,15 +1,5 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <pslib.h>
-#include <psmodules.h>
-
 #include "ppStack.h"
-#include "ppStackLoop.h"
 
 //#define TESTING
-
 
 // Update the value of a concept
@@ -20,6 +10,4 @@
     item->data.F32 = VALUE; \
 }
-
-
 
 bool ppStackConvolve(ppStackOptions *options, pmConfig *config)
@@ -69,6 +57,5 @@
         ppStackFileActivationSingle(config, PPSTACK_FILES_CONVOLVE, true, i);
         if (options->convolve) {
-            // XXX PPSTACK.CONV.KERNEL not defined unless convolve
-            // pmFPAfileActivate(config->files, true, "PPSTACK.CONV.KERNEL");
+            // PPSTACK.CONV.KERNEL not defined unless convolve
             pmFPAfileActivateSingle(config->files, true, "PPSTACK.CONV.KERNEL", i); // Activated file
         }
@@ -191,5 +178,5 @@
         }
         psFree(maskHeader);
-        if (!ppStackWriteImage(options->convVariances->data[i], hdu->header, readout->variance, config)) {
+        if (!ppStackWriteVariance(options->convVariances->data[i], hdu->header, readout->variance, readout->covariance->image, config)) {
             psError(PPSTACK_ERR_IO, false, "Unable to write convolved variance %d", i);
             psFree(fpaList);
