Index: trunk/pswarp/src/pswarpTransformSources.c
===================================================================
--- trunk/pswarp/src/pswarpTransformSources.c	(revision 26896)
+++ trunk/pswarp/src/pswarpTransformSources.c	(revision 27096)
@@ -45,6 +45,6 @@
     psArray *outSources = outDetections->allSources;
     if (!outSources) {
-	outDetections->allSources = psArrayAllocEmpty(SOURCE_ARRAY_BUFFER);
-	outSources = outDetections->allSources;
+        outDetections->allSources = psArrayAllocEmpty(SOURCE_ARRAY_BUFFER);
+        outSources = outDetections->allSources;
     }
 
@@ -61,5 +61,5 @@
         int xGrid, yGrid;           ///< Grid coordinates for local map
         if (!pswarpMapGridSetGrid(sourceGrid, xIn + 0.5, yIn + 0.5, &xGrid, &yGrid)) {
-            psError(PS_ERR_UNKNOWN, false, "Unable to get grid coordinates for source at %f,%f\n",
+            psError(psErrorCodeLast(), false, "Unable to get grid coordinates for source at %f,%f\n",
                     xIn, yIn);
             psFree(outDetections);
@@ -76,5 +76,5 @@
         double xOut, yOut;          ///< Output coordinates
         if (!pswarpMapApply(&xOut, &yOut, map, xIn + 0.5, yIn + 0.5)) {
-            psError(PS_ERR_UNKNOWN, false, "Unable to transform coordinates for source at %f,%f\n",
+            psError(psErrorCodeLast(), false, "Unable to transform coordinates for source at %f,%f\n",
                     xIn, yIn);
             psFree(outDetections);
@@ -111,8 +111,8 @@
 
         new->modelPSF = pmModelAlloc(source->modelPSF->type);
-	new->modelPSF->params->data.F32[PM_PAR_I0]=
-	  (isfinite(new->psfMag) ? pow(10.0, -0.4*new->psfMag) : NAN);
-	new->modelPSF->dparams->data.F32[PM_PAR_I0]=
-	  (isfinite(new->psfMag) ? new->errMag*pow(10.0, -0.4*new->psfMag) : NAN);
+        new->modelPSF->params->data.F32[PM_PAR_I0]=
+          (isfinite(new->psfMag) ? pow(10.0, -0.4*new->psfMag) : NAN);
+        new->modelPSF->dparams->data.F32[PM_PAR_I0]=
+          (isfinite(new->psfMag) ? new->errMag*pow(10.0, -0.4*new->psfMag) : NAN);
 
 #if 0
