gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 3a84a97: All TABs in .c and .h files replaced


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 3a84a97: All TABs in .c and .h files replaced with spaces
Date: Thu, 4 Aug 2016 10:56:40 +0000 (UTC)

branch: master
commit 3a84a97b903788e6fde0ada2e8a64e8753493529
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    All TABs in .c and .h files replaced with spaces
    
    The coding convention that there should be no TABs in indentation was not
    included in Gnuastro from the start. Therefore some of the code that was
    written before its adoption still contained TAB characters used for
    indentation. This was most evident in older utilities like ImageCrop
    (historically, the first utility to be written within Gnuastro and some of
    the older libraries. So with this commit, all the .c and .h files in 'lib/'
    and '/src' were checked and any tabs were replaced with spaces.
    
    Another common occurance of TAB characters was in multi-line macros (to
    fill the space between the end of the code and the '/' character. These
    occurances were also replaced with space characters.
    
    This fixes bug #48692.
---
 lib/arraymanip.c                 |    4 +-
 lib/box.c                        |    8 +-
 lib/checkset.c                   |  232 ++++++++---------
 lib/configfiles.c                |  126 ++++-----
 lib/fits.c                       |  416 ++++++++++++++---------------
 lib/gnuastro/box.h               |    2 +-
 lib/gnuastro/checkset.h          |   59 ++---
 lib/gnuastro/commonargs.h        |   16 +-
 lib/gnuastro/configfiles.h       |   84 +++---
 lib/gnuastro/fixedstringmacros.h |   91 +++----
 lib/gnuastro/linkedlist.h        |    4 +-
 lib/gnuastro/mode.h              |   20 +-
 lib/gnuastro/neighbors.h         |  144 +++++-----
 lib/linkedlist.c                 |   56 ++--
 lib/mesh.c                       |  197 +++++++-------
 lib/mode.c                       |  213 +++++++--------
 lib/spatialconvolve.c            |   17 +-
 lib/statistics.c                 |  172 ++++++------
 lib/threads.c                    |    6 +-
 lib/timing.c                     |    6 +-
 lib/txtarray.c                   |  151 +++++------
 src/arithmetic/args.h            |   18 +-
 src/arithmetic/cite.h            |   18 +-
 src/arithmetic/main.c            |    2 +-
 src/arithmetic/ui.c              |   23 +-
 src/convertt/args.h              |   22 +-
 src/convertt/cite.h              |   16 +-
 src/convertt/jpeg.c              |    4 +-
 src/convertt/main.c              |    2 +-
 src/convertt/ui.c                |  110 ++++----
 src/convolve/args.h              |   26 +-
 src/convolve/cite.h              |   16 +-
 src/convolve/convolve.c          |   20 +-
 src/convolve/ui.c                |  154 +++++------
 src/cosmiccal/args.h             |   22 +-
 src/cosmiccal/cite.h             |   16 +-
 src/cosmiccal/main.c             |    2 +-
 src/cosmiccal/ui.c               |   72 ++---
 src/header/args.h                |   24 +-
 src/header/cite.h                |   18 +-
 src/header/header.c              |    2 +-
 src/header/main.c                |    2 +-
 src/header/ui.c                  |   42 +--
 src/imgcrop/args.h               |   71 ++---
 src/imgcrop/cite.h               |   16 +-
 src/imgcrop/crop.c               |  263 ++++++++++---------
 src/imgcrop/imgcrop.c            |  152 +++++------
 src/imgcrop/main.c               |    2 +-
 src/imgcrop/ui.c                 |  343 ++++++++++++------------
 src/imgcrop/wcsmode.c            |  138 +++++-----
 src/imgstat/args.h               |   24 +-
 src/imgstat/cite.h               |   16 +-
 src/imgstat/imgstat.c            |   46 ++--
 src/imgstat/main.c               |    4 +-
 src/imgstat/ui.c                 |  149 +++++------
 src/imgwarp/args.h               |   34 +--
 src/imgwarp/cite.h               |   16 +-
 src/imgwarp/imgwarp.c            |   32 ++-
 src/imgwarp/ui.c                 |   46 ++--
 src/mkcatalog/args.h             |   24 +-
 src/mkcatalog/cite.h             |   16 +-
 src/mkcatalog/main.c             |    2 +-
 src/mkcatalog/ui.c               |  126 +++++----
 src/mknoise/args.h               |   24 +-
 src/mknoise/cite.h               |   16 +-
 src/mknoise/main.c               |    2 +-
 src/mknoise/mknoise.c            |   35 +--
 src/mknoise/ui.c                 |   48 ++--
 src/mkprof/args.h                |   48 ++--
 src/mkprof/cite.h                |   16 +-
 src/mkprof/main.c                |    2 +-
 src/mkprof/mkprof.c              |  312 +++++++++++-----------
 src/mkprof/oneprofile.c          |   58 +++--
 src/mkprof/profiles.c            |    8 +-
 src/mkprof/ui.c                  |  375 +++++++++++++-------------
 src/noisechisel/args.h           |   24 +-
 src/noisechisel/binary.c         |  116 +++++----
 src/noisechisel/cite.h           |   16 +-
 src/noisechisel/clumps.c         |   86 +++---
 src/noisechisel/detection.c      |   20 +-
 src/noisechisel/label.c          |   38 +--
 src/noisechisel/label.h          |    2 +-
 src/noisechisel/main.c           |    4 +-
 src/noisechisel/segmentation.c   |  129 ++++-----
 src/noisechisel/ui.c             |  536 +++++++++++++++++++-------------------
 src/subtractsky/args.h           |   24 +-
 src/subtractsky/cite.h           |   16 +-
 src/subtractsky/main.c           |    2 +-
 src/subtractsky/ui.c             |  296 ++++++++++-----------
 89 files changed, 3258 insertions(+), 3170 deletions(-)

diff --git a/lib/arraymanip.c b/lib/arraymanip.c
index 255d797..ac5e62c 100644
--- a/lib/arraymanip.c
+++ b/lib/arraymanip.c
@@ -50,7 +50,7 @@ gal_arraymanip_uchar_init_on_region(unsigned char *in, const 
unsigned char v,
     {
       fp = (p=in+start) + s1;
       do
-       *p=v;
+        *p=v;
       while(++p<fp);
       start+=is1;
     }
@@ -81,7 +81,7 @@ gal_arraymanip_long_init_on_region(long *in, const long v, 
size_t start,
     {
       fp = (p=in+start) + s1;
       do
-       *p=v;
+        *p=v;
       while(++p<fp);
       start+=is1;
     }
diff --git a/lib/box.c b/lib/box.c
index 756b052..365d027 100644
--- a/lib/box.c
+++ b/lib/box.c
@@ -31,7 +31,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 /*                        IMPORTANT NOTE:
-        All the axises are based on the FITS standard, not C.
+         All the axises are based on the FITS standard, not C.
 */
 
 
@@ -108,7 +108,7 @@ gal_box_border_from_center(double xc, double yc, long 
*width,
   /*
   printf("\n\nCenter is on: %ld, %ld\n", lxc, lyc);
   printf("Starting and ending pixels: (%ld, %ld) -- (%ld, %ld)\n\n\n",
-        fpixel[0], fpixel[1], lpixel[0], lpixel[1]);
+         fpixel[0], fpixel[1], lpixel[0], lpixel[1]);
   */
 }
 
@@ -254,9 +254,9 @@ gal_box_overlap(long *naxes, long *fpixel_i, long *lpixel_i,
   /* In case you wish to see the results.
   printf("\nAfter correction:\n");
   printf("Input image: (%ld, %ld) -- (%ld, %ld)\n", fpixel_i[0],
-        fpixel_i[1], lpixel_i[0], lpixel_i[1]);
+         fpixel_i[1], lpixel_i[0], lpixel_i[1]);
   printf("output image:(%ld, %ld) -- (%ld, %ld)\n\n\n", fpixel_o[0],
-        fpixel_o[1], lpixel_o[0], lpixel_o[1]);
+         fpixel_o[1], lpixel_o[0], lpixel_o[1]);
   */
 
   if(fpixel_i[0]>naxes[0] || fpixel_i[1]>naxes[1]
diff --git a/lib/checkset.c b/lib/checkset.c
index bc32a65..6715029 100644
--- a/lib/checkset.c
+++ b/lib/checkset.c
@@ -44,13 +44,13 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #define NOTEMSG_SMALLERONE  "should be >=0 and <=1"
 
 
-#define CHECKFULLNUMBER   if(*tailptr!='\0'){                          \
-    if(filename)                                                       \
-      error_at_line(EXIT_FAILURE, 0, filename, lineno,                 \
-                   FIXEDFORFILE" "NOTEMSG_NOTNUMBER, lo, optarg);      \
-    else                                                               \
-      error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_NOTNUMBER,       \
-           lo, so, optarg);                                            \
+#define CHECKFULLNUMBER   if(*tailptr!='\0'){                           \
+    if(filename)                                                        \
+      error_at_line(EXIT_FAILURE, 0, filename, lineno,                  \
+                    FIXEDFORFILE" "NOTEMSG_NOTNUMBER, lo, optarg);      \
+    else                                                                \
+      error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_NOTNUMBER,        \
+            lo, so, optarg);                                            \
   }
 
 
@@ -112,11 +112,11 @@ gal_checkset_int_zero_or_one(char *optarg, int *var, char 
*lo, char so,
   if(tmp!=0 && tmp!=1)
     {
       if(filename)
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     FIXEDFORFILE" "NOTEMSG_EQZEROORONE, lo, optarg);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      FIXEDFORFILE" "NOTEMSG_EQZEROORONE, lo, optarg);
       else
-       error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_EQZEROORONE,
-             lo, so, optarg);
+        error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_EQZEROORONE,
+              lo, so, optarg);
     }
 }
 
@@ -137,11 +137,11 @@ gal_checkset_int_4_or_8(char *optarg, int *var, char *lo, 
char so, char *spack,
   if(tmp!=4 && tmp!=8)
     {
       if(filename)
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     FIXEDFORFILE" "NOTEMSG_EQZEROORONE, lo, optarg);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      FIXEDFORFILE" "NOTEMSG_EQZEROORONE, lo, optarg);
       else
-       error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_EQZEROORONE,
-             lo, so, optarg);
+        error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_EQZEROORONE,
+              lo, so, optarg);
     }
 }
 
@@ -161,11 +161,11 @@ gal_checkset_int_el_zero(char *optarg, int *var, char 
*lo, char so, char *spack,
   if(tmp<0)
     {
       if(filename)
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     FIXEDFORFILE" "NOTEMSG_LEQZERO, lo, optarg);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      FIXEDFORFILE" "NOTEMSG_LEQZERO, lo, optarg);
       else
-       error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LEQZERO,
-             lo, so, optarg);
+        error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LEQZERO,
+              lo, so, optarg);
     }
 }
 
@@ -185,11 +185,11 @@ gal_checkset_int_l_zero(char *optarg, int *var, char *lo, 
char so, char *spack,
   if(tmp<=0)
     {
       if(filename)
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     FIXEDFORFILE" "NOTEMSG_LARGERZERO, lo, optarg);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      FIXEDFORFILE" "NOTEMSG_LARGERZERO, lo, optarg);
       else
-       error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LARGERZERO,
-             lo, so, optarg);
+        error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LARGERZERO,
+              lo, so, optarg);
     }
 }
 
@@ -210,11 +210,11 @@ gal_checkset_int_smaller_equal_to(char *optarg, int *var, 
char *lo, char so,
   if(tmp>maxvalue)
     {
       if(filename)
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     FIXEDFORFILE" "NOTEMSG_4OR8, lo, optarg);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      FIXEDFORFILE" "NOTEMSG_4OR8, lo, optarg);
       else
-       error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_4OR8,
-             lo, so, optarg);
+        error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_4OR8,
+              lo, so, optarg);
     }
 }
 
@@ -234,11 +234,11 @@ gal_checkset_long_el_zero(char *optarg, long *var, char 
*lo, char so,
   if(tmp<0)
     {
       if(filename)
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     FIXEDFORFILE" "NOTEMSG_LEQZERO, lo, optarg);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      FIXEDFORFILE" "NOTEMSG_LEQZERO, lo, optarg);
       else
-       error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LEQZERO,
-             lo, so, optarg);
+        error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LEQZERO,
+              lo, so, optarg);
     }
 }
 
@@ -277,11 +277,11 @@ gal_checkset_sizet_el_zero(char *optarg, size_t *var, 
char *lo, char so,
   if(tmp<0)
     {
       if(filename)
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     FIXEDFORFILE" "NOTEMSG_LEQZERO, lo, optarg);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      FIXEDFORFILE" "NOTEMSG_LEQZERO, lo, optarg);
       else
-       error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LEQZERO,
-             lo, so, optarg);
+        error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LEQZERO,
+              lo, so, optarg);
     }
 }
 
@@ -301,11 +301,11 @@ gal_checkset_sizet_l_zero(char *optarg, size_t *var, char 
*lo, char so,
   if(tmp<=0)
     {
       if(filename)
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     FIXEDFORFILE" "NOTEMSG_LARGERZERO, lo, optarg);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      FIXEDFORFILE" "NOTEMSG_LARGERZERO, lo, optarg);
       else
-       error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LARGERZERO,
-             lo, so, optarg);
+        error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LARGERZERO,
+              lo, so, optarg);
     }
 }
 
@@ -326,11 +326,11 @@ gal_checkset_sizet_p_odd(char *optarg, size_t *var, char 
*lo, char so,
   if(tmp<0 || tmp%2==0)
     {
       if(filename)
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     FIXEDFORFILE" should be >0 and odd.", lo, optarg);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      FIXEDFORFILE" should be >0 and odd.", lo, optarg);
       else
-       error(EXIT_FAILURE, 0, FIXEDFOROPTION" should be >0 and odd",
-             lo, so, optarg);
+        error(EXIT_FAILURE, 0, FIXEDFOROPTION" should be >0 and odd",
+              lo, so, optarg);
     }
 }
 
@@ -350,11 +350,11 @@ gal_checkset_float_l_0(char *optarg, float *var, char 
*lo, char so, char* spack,
   if(tmp<=0)
     {
       if(filename)
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     FIXEDFORFILE" "NOTEMSG_LARGERZERO, lo, optarg);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      FIXEDFORFILE" "NOTEMSG_LARGERZERO, lo, optarg);
       else
-       error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LARGERZERO,
-             lo, so, optarg);
+        error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LARGERZERO,
+              lo, so, optarg);
     }
 }
 
@@ -374,11 +374,11 @@ gal_checkset_float_l_0_s_1(char *optarg, float *var, char 
*lo, char so,
   if(tmp>1.0f || tmp<0)
     {
       if(filename)
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     FIXEDFORFILE" "NOTEMSG_SMALLERONE, lo, optarg);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      FIXEDFORFILE" "NOTEMSG_SMALLERONE, lo, optarg);
       else
-       error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_SMALLERONE,
-             lo, so, optarg);
+        error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_SMALLERONE,
+              lo, so, optarg);
     }
 }
 
@@ -410,11 +410,11 @@ gal_checkset_double_l_0(char *optarg, double *var, char 
*lo, char so,
   if(tmp<=0)
     {
       if(filename)
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     FIXEDFORFILE" "NOTEMSG_LARGERZERO, lo, optarg);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      FIXEDFORFILE" "NOTEMSG_LARGERZERO, lo, optarg);
       else
-       error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LARGERZERO,
-             lo, so, optarg);
+        error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LARGERZERO,
+              lo, so, optarg);
     }
 }
 
@@ -434,11 +434,11 @@ gal_checkset_double_el_0(char *optarg, double *var, char 
*lo, char so,
   if(tmp<0)
     {
       if(filename)
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     FIXEDFORFILE" "NOTEMSG_LARGERZERO, lo, optarg);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      FIXEDFORFILE" "NOTEMSG_LARGERZERO, lo, optarg);
       else
-       error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LARGERZERO,
-             lo, so, optarg);
+        error(EXIT_FAILURE, 0, FIXEDFOROPTION" "NOTEMSG_LARGERZERO,
+              lo, so, optarg);
     }
 }
 
@@ -459,11 +459,11 @@ gal_checkset_double_l_value(char *optarg, double *var, 
char *lo, char so,
   if(tmp<=value)
     {
       if(filename)
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     FIXEDFORFILE" should be > %.4f", lo, optarg, value);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      FIXEDFORFILE" should be > %.4f", lo, optarg, value);
       else
-       error(EXIT_FAILURE, 0, FIXEDFOROPTION" should be > %.4f",
-             lo, so, optarg, value);
+        error(EXIT_FAILURE, 0, FIXEDFOROPTION" should be > %.4f",
+              lo, so, optarg, value);
     }
 }
 
@@ -510,7 +510,7 @@ gal_checkset_string_has_space(char *in)
     switch(*in)
       {
       case ' ': case '\t': case '\v':
-       return 1;
+        return 1;
       }
   while(*(++in)!='\0');
   return 0;
@@ -609,10 +609,10 @@ gal_checkset_check_file(char *filename)
   FILE *tmpfile;
   errno=0;
   tmpfile = fopen(filename, "r");
-  if(tmpfile)                  /* The file opened. */
+  if(tmpfile)                        /* The file opened. */
     {
       if(fclose(tmpfile)==EOF)
-       error(EXIT_FAILURE, errno, "%s", filename);
+        error(EXIT_FAILURE, errno, "%s", filename);
     }
   else
     error(EXIT_FAILURE, errno, "%s", filename);
@@ -634,21 +634,21 @@ gal_checkset_check_remove_file(char *filename, int 
dontdelete)
      `r+`. */
   errno=0;
   tmpfile=fopen(filename, "r+");
-  if (tmpfile)                 /* The file opened. */
+  if (tmpfile)                        /* The file opened. */
     {
       /* Close the file and make sure that it should be deleted. */
       errno=0;
       if(fclose(tmpfile))
-       error(EXIT_FAILURE, errno, "%s", filename);
+        error(EXIT_FAILURE, errno, "%s", filename);
       if(dontdelete)
-       error(EXIT_FAILURE, 0, "%s already exists and you have "
-             "asked to not remove it with the `--dontdelete` "
-             "(`-D`) option", filename);
+        error(EXIT_FAILURE, 0, "%s already exists and you have "
+              "asked to not remove it with the `--dontdelete` "
+              "(`-D`) option", filename);
 
       /* Delete the file: */
       errno=0;
       if(unlink(filename))
-       error(EXIT_FAILURE, errno, "%s", filename);
+        error(EXIT_FAILURE, errno, "%s", filename);
     }
   /* If the file doesn't exist, there is no problem, we wanted to
      remove it any way! Any other kind of error should not be
@@ -680,42 +680,42 @@ gal_checkset_dir_0_file_1(char *name, int dontdelete)
   errno=0;
   if(stat(name, &nameinfo)!=0)
     {
-      if(errno==ENOENT)        /* ENOENT: No such file or directory. */
-       {/* Make the file temporarily and see if everything is ok. */
-         errno=0;
-         tmpfile=fopen(name, "w");
-         if (tmpfile)
-           {
-             fprintf(tmpfile, "Only to test write access.");
-             errno=0;
-             if(fclose(tmpfile))
-               error(EXIT_FAILURE, errno, "%s", name);
-             errno=0;
-             if(unlink(name))
-               error(EXIT_FAILURE, errno, "%s", name);
-           }
-         else
-           error(EXIT_FAILURE, errno, "%s", name);
-         return 1;             /* It is a file name, GOOD */
-       }
-      else                     /* Some strange condition, ABORT */
-       error(EXIT_FAILURE, errno, "%s", name);
+      if(errno==ENOENT)        /* ENOENT: No such file or directory. */
+        {/* Make the file temporarily and see if everything is ok. */
+          errno=0;
+          tmpfile=fopen(name, "w");
+          if (tmpfile)
+            {
+              fprintf(tmpfile, "Only to test write access.");
+              errno=0;
+              if(fclose(tmpfile))
+                error(EXIT_FAILURE, errno, "%s", name);
+              errno=0;
+              if(unlink(name))
+                error(EXIT_FAILURE, errno, "%s", name);
+            }
+          else
+            error(EXIT_FAILURE, errno, "%s", name);
+          return 1;                    /* It is a file name, GOOD */
+        }
+      else                             /* Some strange condition, ABORT */
+        error(EXIT_FAILURE, errno, "%s", name);
     }
 
-  if(S_ISDIR(nameinfo.st_mode))        /* It is a directory, BAD */
+  if(S_ISDIR(nameinfo.st_mode))        /* It is a directory, BAD */
     return 0;
-  else if (S_ISREG(nameinfo.st_mode)) /* It is a file, GOOD. */
+  else if (S_ISREG(nameinfo.st_mode))  /* It is a file, GOOD. */
     {
       gal_checkset_check_remove_file(name, dontdelete);
       return 1;
     }
-  else                                 /* Not a file or a dir, ABORT */
+  else                                 /* Not a file or a dir, ABORT */
     error(EXIT_FAILURE, 0, "%s not a file or a directory", name);
 
-  error(EXIT_FAILURE, 0, "a bug! In gal_checkset_dir_0_file_1, (in checkset.c) 
"
-       "The process should not reach the end of the function! Please "
-        "contact us at "PACKAGE_BUGREPORT" so we can see what went wrong "
-        "and fix it in future updates");
+  error(EXIT_FAILURE, 0, "a bug! In gal_checkset_dir_0_file_1, (in "
+        "checkset.c). The process should not reach the end of the "
+        "function! Please contact us at "PACKAGE_BUGREPORT" so we can "
+        "see what went wrong and fix it in future updates");
   return 0;
 }
 
@@ -728,7 +728,7 @@ gal_checkset_dir_0_file_1(char *name, int dontdelete)
    be removed and the given suffix will be put in the end. */
 void
 gal_checkset_automatic_output(char *inname, char *suffix, int removedirinfo,
-               int dontdelete, char **outname)
+                int dontdelete, char **outname)
 {
   char *out;
   size_t i, l, offset=0;
@@ -746,15 +746,15 @@ gal_checkset_automatic_output(char *inname, char *suffix, 
int removedirinfo,
   for(i=l;i!=0;--i)
     {
       /* We don't want to remove any '.' in a directory name so if a
-        '/' is encountered in our search from the end of the file
-        name, we won't continue. */
+         '/' is encountered in our search from the end of the file
+         name, we won't continue. */
       if(out[i]=='/') break;
       else if(out[i]=='.')
-       {
-         out[i]='\0';
-         strcat(out, suffix);
-         break;
-       }
+        {
+          out[i]='\0';
+          strcat(out, suffix);
+          break;
+        }
     }
 
   /* If it is desired to remove the directory information from the
@@ -764,12 +764,12 @@ gal_checkset_automatic_output(char *inname, char *suffix, 
int removedirinfo,
   if(removedirinfo)
     {
       l=strlen(out);
-      for(i=l;i!=0;--i)                  /* Find the last forward slash.      
*/
-       if(out[i]=='/')
-         {offset=i+1; break;}
+      for(i=l;i!=0;--i)         /* Find the last forward slash.      */
+        if(out[i]=='/')
+          {offset=i+1; break;}
       if(offset)
-       for(i=offset;i<=l;++i)  /* <= because we want to shift the   */
-         out[i-offset]=out[i]; /* '\0' character in the string too. */
+        for(i=offset;i<=l;++i)  /* <= because we want to shift the   */
+          out[i-offset]=out[i]; /* '\0' character in the string too. */
     }
 
   /* Remove the created filename if it already exits. */
@@ -877,24 +877,24 @@ gal_checkset_check_dir_write_add_slash(char **dirname)
   file_d=mkstemp(tmpname);
   if(file_d==-1)
     error(EXIT_FAILURE, errno, "cannot write output in the directory %s",
-         indir);
+          indir);
   /*
   errno=0;
   printf("\n\n%s\n\n", tmpname);
   if( write(file_d, buf, strlen(buf)) == -1 )
     error(EXIT_FAILURE, errno, "%s: writing to this temporary file to "
-         "check the given `%s` directory", tmpname, indir);
+          "check the given `%s` directory", tmpname, indir);
   */
   errno=0;
   if( close(file_d) == -1 )
     error(EXIT_FAILURE, errno, "%s: Closing this temporary file to check "
-         "the given `%s` directory", tmpname, indir);
+          "the given `%s` directory", tmpname, indir);
 
   /* Delete the temporary file: */
   errno=0;
   if(unlink(tmpname)==-1)
     error(EXIT_FAILURE, errno, "%s: removing this temporary file made "
-         "to check the given `%s directory`", tmpname, indir);
+          "to check the given `%s directory`", tmpname, indir);
 
   /* Remove the extra characters that were added for the random name. */
   tmpname[strlen(tmpname)-14]='\0';
diff --git a/lib/configfiles.c b/lib/configfiles.c
index ef15fcc..3ce15a1 100644
--- a/lib/configfiles.c
+++ b/lib/configfiles.c
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <assert.h>
 #include <string.h>
 #include <dirent.h>
-#include <sys/stat.h>          /* For mkdir permission flags. */
+#include <sys/stat.h>                /* For mkdir permission flags. */
 
 #include <gnuastro/checkset.h>
 #include <gnuastro/configfiles.h>
@@ -48,7 +48,7 @@ gal_configfiles_add_home_dir(char *dir)
   home=getenv("HOME");
   if(home==NULL)
     error(EXIT_FAILURE, 0, "the HOME environment variable "
-         "is not defined");
+          "is not defined");
 
   /* Concatenate the two strings together: */
   return gal_checkset_malloc_cat(home, dir);
@@ -73,48 +73,48 @@ gal_configfiles_read_name_value(char *line, char *filename, 
size_t lineno,
     switch(*line)
       {
       case ' ': case '\t': case '\v': case '\n': case '\r':
-       if(inword) /* Only considered in a word, not in a quote*/
-         {
-           inword=0;
-           *line='\0';
-           if(*value && inquote==0)
-             notyetfinished=0;
-         }
-       break;
+        if(inword) /* Only considered in a word, not in a quote*/
+          {
+            inword=0;
+            *line='\0';
+            if(*value && inquote==0)
+              notyetfinished=0;
+          }
+        break;
       case '#':
-       notyetfinished=0;
-       break;
+        notyetfinished=0;
+        break;
       case '"':
-       if(inword)
-         error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                       "Quotes have to be surrounded by whitespace "
-                       "characters (space, tab, new line, etc).");
-       if(inquote)
-         {
-           *line='\0';
-           inquote=0;
-           notyetfinished=0;
-         }
-       else
-         {
-           if(*name==NULL)
-             error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                           "Parameter name should not start with "
-                           "double quotes (\").");
-           inquote=1;
-           *value=line+1;
-         }
-       break;
+        if(inword)
+          error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                        "Quotes have to be surrounded by whitespace "
+                        "characters (space, tab, new line, etc).");
+        if(inquote)
+          {
+            *line='\0';
+            inquote=0;
+            notyetfinished=0;
+          }
+        else
+          {
+            if(*name==NULL)
+              error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                            "Parameter name should not start with "
+                            "double quotes (\").");
+            inquote=1;
+            *value=line+1;
+          }
+        break;
       default:
-       if(inword==0 && inquote==0)
-         {
-           if(*name==NULL)
-             *name=line;
-           else  /* name is set, now assign *value. */
-             *value=line;
-           inword=1;
-         }
-       break;
+        if(inword==0 && inquote==0)
+          {
+            if(*name==NULL)
+              *name=line;
+            else  /* name is set, now assign *value. */
+              *value=line;
+            inword=1;
+          }
+        break;
       }
   while(*(++line)!='\0' && notyetfinished);
 
@@ -132,8 +132,8 @@ gal_configfiles_read_name_value(char *line, char *filename, 
size_t lineno,
   /* Name or value were set but not yet finished. */
   if(notyetfinished)
     error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                 "line finished before parameter name and "
-                 "value could be read.");
+                  "line finished before parameter name and "
+                  "value could be read.");
 }
 
 
@@ -154,24 +154,24 @@ gal_configfiles_write_local_config_stop(char *indir, char 
*filename,
 
   /* Make sure the directory exists, if it doesn't, try to make it.*/
   dp=opendir(indir);
-  if(dp==NULL)                 /* The directory could not be opened. */
+  if(dp==NULL)               /* The directory could not be opened. */
     {
       if(errno==ENOENT)
-       {
-         errno=0;
-         if(mkdir(indir, S_IRWXU)==-1)
-           error(EXIT_FAILURE, errno, "%s: could not be created. Try "
-                 "running:\n\n    mkdir -p %s\n\nto built it and run "
+        {
+          errno=0;
+          if(mkdir(indir, S_IRWXU)==-1)
+            error(EXIT_FAILURE, errno, "%s: could not be created. Try "
+                  "running:\n\n    mkdir -p %s\n\nto built it and run "
                   "your previous command again", indir, indir);
-       }
+        }
       else
-       error(EXIT_FAILURE, errno, "%s", indir);
+        error(EXIT_FAILURE, errno, "%s", indir);
     }
   else
     {
       errno=0;
       if (closedir(dp)==-1)
-       error(EXIT_FAILURE, errno, "%s", indir);
+        error(EXIT_FAILURE, errno, "%s", indir);
     }
 
 
@@ -187,17 +187,17 @@ gal_configfiles_write_local_config_stop(char *indir, char 
*filename,
 
   /* write the comments: */
   fprintf(fp, "# Default parameters for %s (%s).\n"
-         "# %s is part of GNU Astronomy Utitlies.\n"
-         "# This file was created on %s#\n"
-         "# Use the long option name of each paramter followed by\n"
-         "# a value. The name and value should be separated by\n"
-         "# at least one of the following characters:\n"
-         "# space, `,`, `=` or `:`.\n#\n"
-         "# Run `%s --help` or `info %s`\n"
-         "# for more information.\n#\n"
-         "# NOTE I:  All counting is from zero, not one.\n"
-         "# NOTE II: Lines starting with `#` are ignored.\n",
-         spack_name, spack, spack_name, ctime(&rawtime), spack, spack);
+          "# %s is part of GNU Astronomy Utitlies.\n"
+          "# This file was created on %s#\n"
+          "# Use the long option name of each paramter followed by\n"
+          "# a value. The name and value should be separated by\n"
+          "# at least one of the following characters:\n"
+          "# space, `,`, `=` or `:`.\n#\n"
+          "# Run `%s --help` or `info %s`\n"
+          "# for more information.\n#\n"
+          "# NOTE I:  All counting is from zero, not one.\n"
+          "# NOTE II: Lines starting with `#` are ignored.\n",
+          spack_name, spack, spack_name, ctime(&rawtime), spack, spack);
 
   return fp;
 }
diff --git a/lib/fits.c b/lib/fits.c
index f282dd8..5030001 100644
--- a/lib/fits.c
+++ b/lib/fits.c
@@ -47,9 +47,9 @@ gal_fits_io_error(int status, char *message)
     {
       fits_report_error(stderr, status);
       if(message)
-       error(EXIT_FAILURE, 0, "%s", message);
+        error(EXIT_FAILURE, 0, "%s", message);
       else
-       error(EXIT_FAILURE, 0, "%s", defmessage);
+        error(EXIT_FAILURE, 0, "%s", defmessage);
     }
 }
 
@@ -138,11 +138,11 @@ gal_fits_img_bitpix_size(fitsfile *fptr, int *bitpix, 
long *naxes)
 
   if(naxis!=2)
     error(EXIT_FAILURE, 0, "currently only a 2 dimensional image array "
-         "is supported. Your array is %d dimension(s). %s", naxis,
-         naxis ? "Please contact us to add this feature." : "This might "
+          "is supported. Your array is %d dimension(s). %s", naxis,
+          naxis ? "Please contact us to add this feature." : "This might "
           "Be due to the fact that the data in images with multiple "
-          "extensions are sometimes put on the second extension. If this is "
-          "the case, try changing the hdu (maybe to --hdu=1)");
+          "extensions are sometimes put on the second extension. If this "
+          "is the case, try changing the hdu (maybe to --hdu=1)");
 }
 
 
@@ -169,7 +169,7 @@ gal_fits_bitpix_to_dtype(int bitpix)
       return TDOUBLE;
     default:
       error(EXIT_FAILURE, 0, "bitpix value of %d not recognized",
-           bitpix);
+            bitpix);
     }
   return 0;
 }
@@ -194,48 +194,48 @@ gal_fits_bitpix_blank(int bitpix)
     case BYTE_IMG:
       b=malloc(sizeof(unsigned char));
       if(b==NULL)
-       error(EXIT_FAILURE, errno, "%lu bytes", sizeof(unsigned char));
+        error(EXIT_FAILURE, errno, "%lu bytes", sizeof(unsigned char));
       *b=GAL_FITS_BYTE_BLANK;
       return b;
 
     case SHORT_IMG:
       s=malloc(sizeof(short));
       if(s==NULL)
-       error(EXIT_FAILURE, errno, "%lu bytes", sizeof(short));
+        error(EXIT_FAILURE, errno, "%lu bytes", sizeof(short));
       *s=GAL_FITS_SHORT_BLANK;
       return s;
 
     case LONG_IMG:
       l=malloc(sizeof(long));
       if(l==NULL)
-       error(EXIT_FAILURE, errno, "%lu bytes", sizeof(long));
+        error(EXIT_FAILURE, errno, "%lu bytes", sizeof(long));
       *l=GAL_FITS_LONG_BLANK;
       return l;
 
     case LONGLONG_IMG:
       L=malloc(sizeof(LONGLONG));
       if(L==NULL)
-       error(EXIT_FAILURE, errno, "%lu bytes", sizeof(LONGLONG));
+        error(EXIT_FAILURE, errno, "%lu bytes", sizeof(LONGLONG));
       *L=GAL_FITS_LLONG_BLANK;
       return L;
 
     case FLOAT_IMG:
       f=malloc(sizeof(float));
       if(f==NULL)
-       error(EXIT_FAILURE, errno, "%lu bytes", sizeof(float));
+        error(EXIT_FAILURE, errno, "%lu bytes", sizeof(float));
       *f=GAL_FITS_FLOAT_BLANK;
       return f;
 
     case DOUBLE_IMG:
       d=malloc(sizeof(double));
       if(d==NULL)
-       error(EXIT_FAILURE, errno, "%lu bytes", sizeof(double));
+        error(EXIT_FAILURE, errno, "%lu bytes", sizeof(double));
       *d=GAL_FITS_FLOAT_BLANK;
       return d;
 
     default:
       error(EXIT_FAILURE, 0, "bitpix value of %d not recognized",
-           bitpix);
+            bitpix);
     }
 
   return NULL;
@@ -272,7 +272,7 @@ gal_fits_bitpix_alloc(size_t size, int bitpix)
 
     case FLOAT_IMG:
       if(sizeof(float)!=4)
-       error(EXIT_FAILURE, 0,
+        error(EXIT_FAILURE, 0,
               "`float` is not 32bits on this machine. The FITS standard "
               "Requires this size");
       size*=sizeof(float);
@@ -280,7 +280,7 @@ gal_fits_bitpix_alloc(size_t size, int bitpix)
 
     case DOUBLE_IMG:
       if(sizeof(double)!=8)
-       error(EXIT_FAILURE, 0,
+        error(EXIT_FAILURE, 0,
               "`double` is not 64bits on this machine. The FITS standard "
               "requires this size");
       size*=sizeof(double);
@@ -305,12 +305,15 @@ gal_fits_bitpix_alloc(size_t size, int bitpix)
 void
 blanktovalue(void *array, int bitpix, size_t size, void *value)
 {
-  unsigned char *b, *bf, bv=*(uint8_t *) value; /* Value will only be read*/
-  short *s, *sf, sv=*(int16_t *) value;   /* from one of these based on    */
-  long *l, *lf, lv=*(int32_t *) value; /* bitpix. Which the caller assigned.*/
-  LONGLONG *L, *Lf, Lv=*(int64_t *) value; /* If there is any problem, it  */
-  float   *f, *ff, fv=*(float   *) value; /* is their responsability, not */
-  double  *d, *df, dv=*(double  *) value; /* this functions :-D.          */
+  /* 'value' will only be read from one of these based on bitpix. Which the
+     caller assigned. If there is any problem, it is their responsability,
+     not this functions :-).*/
+  unsigned char *b, *bf, bv=*(uint8_t *) value;
+  short *s, *sf, sv=*(int16_t *) value;
+  long *l, *lf, lv=*(int32_t *) value;
+  LONGLONG *L, *Lf, Lv=*(int64_t *) value;
+  float   *f, *ff, fv=*(float   *) value;
+  double  *d, *df, dv=*(double  *) value;
 
   switch(bitpix)
     {
@@ -346,8 +349,8 @@ blanktovalue(void *array, int bitpix, size_t size, void 
*value)
 
     default:
       error(EXIT_FAILURE, 0, "a bug! Bitpix value of %d not recognized. "
-           "This should not happen here (blanktovalue in fitsarrayvv.c). "
-           "Please contact us at %s to see how this happened", bitpix,
+            "This should not happen here (blanktovalue in fitsarrayvv.c). "
+            "Please contact us at %s to see how this happened", bitpix,
             PACKAGE_BUGREPORT);
     }
 }
@@ -374,272 +377,272 @@ gal_fits_change_type(void *in, int inbitpix, size_t 
size, int anyblank,
     {
     case BYTE_IMG:
       switch(inbitpix)
-       {
-       case BYTE_IMG:
-         bf=(b=*out)+size; do *b=*ib++; while(++b<bf); return;
-       case SHORT_IMG:
-         bf=(b=*out)+size; do *b=*is++; while(++b<bf);
+        {
+        case BYTE_IMG:
+          bf=(b=*out)+size; do *b=*ib++; while(++b<bf); return;
+        case SHORT_IMG:
+          bf=(b=*out)+size; do *b=*is++; while(++b<bf);
           if(anyblank)
             {b=*out; do {b[i]=(iis[i]==GAL_FITS_SHORT_BLANK)
                          ?GAL_FITS_BYTE_BLANK:b[i];}
               while(++i!=size);}
           return;
-       case LONG_IMG:
-         bf=(b=*out)+size; do *b=*il++; while(++b<bf);
+        case LONG_IMG:
+          bf=(b=*out)+size; do *b=*il++; while(++b<bf);
           if(anyblank)
             {b=*out; do {b[i]=(iil[i]==GAL_FITS_LONG_BLANK)
                          ?GAL_FITS_BYTE_BLANK:b[i];}
               while(++i!=size);}
           return;
-       case LONGLONG_IMG:
-         bf=(b=*out)+size; do *b=*iL++; while(++b<bf);
+        case LONGLONG_IMG:
+          bf=(b=*out)+size; do *b=*iL++; while(++b<bf);
           if(anyblank)
             {b=*out; do {b[i]=(iiL[i]==GAL_FITS_LLONG_BLANK)
                          ?GAL_FITS_BYTE_BLANK:b[i];}
               while(++i!=size);}
           return;
-       case FLOAT_IMG:
-         bf=(b=*out)+size; do *b=roundf(*iif++); while(++b<bf);
+        case FLOAT_IMG:
+          bf=(b=*out)+size; do *b=roundf(*iif++); while(++b<bf);
           if(anyblank)
             {b=*out; do {b[i]=isnan(iiif[i])?GAL_FITS_BYTE_BLANK:b[i];}
               while(++i!=size);}
           return;
-       case DOUBLE_IMG:
-         bf=(b=*out)+size; do *b=round(*id++); while(++b<bf);
+        case DOUBLE_IMG:
+          bf=(b=*out)+size; do *b=round(*id++); while(++b<bf);
           if(anyblank)
             {b=*out; do {b[i]=isnan(iid[i])?GAL_FITS_BYTE_BLANK:b[i];}
               while(++i!=size);}
           return;
-       default:
-         error(EXIT_FAILURE, 0, "a bug!  In gal_fits_change_type "
-                "(fitsarrayvv.c). BITPIX=%d of input not recognized.  Please "
-                "contact us so we can fix it", inbitpix);
-       }
+        default:
+          error(EXIT_FAILURE, 0, "a bug!  In gal_fits_change_type "
+                "(fitsarrayvv.c). BITPIX=%d of input not recognized. "
+                "Please contact us so we can fix it", inbitpix);
+        }
       break;
 
     case SHORT_IMG:
       switch(inbitpix)
-       {
-       case BYTE_IMG:
-         sf=(s=*out)+size; do *s=*ib++; while(++s<sf);
+        {
+        case BYTE_IMG:
+          sf=(s=*out)+size; do *s=*ib++; while(++s<sf);
           if(anyblank)
             {s=*out; do {s[i]=(iib[i]==GAL_FITS_BYTE_BLANK)
                          ?GAL_FITS_SHORT_BLANK:s[i];}
               while(++i!=size);}
           return;
-       case SHORT_IMG:
-         sf=(s=*out)+size; do *s=*is++; while(++s<sf); return;
-       case LONG_IMG:
-         sf=(s=*out)+size; do *s=*il++; while(++s<sf);
+        case SHORT_IMG:
+          sf=(s=*out)+size; do *s=*is++; while(++s<sf); return;
+        case LONG_IMG:
+          sf=(s=*out)+size; do *s=*il++; while(++s<sf);
           if(anyblank)
             {s=*out; do {s[i]=(iil[i]==GAL_FITS_LONG_BLANK)
                          ?GAL_FITS_SHORT_BLANK:s[i];}
               while(++i!=size);}
           return;
-       case LONGLONG_IMG:
-         sf=(s=*out)+size; do *s=*iL++; while(++s<sf);
+        case LONGLONG_IMG:
+          sf=(s=*out)+size; do *s=*iL++; while(++s<sf);
           if(anyblank)
             {s=*out; do {s[i]=(iiL[i]==GAL_FITS_LLONG_BLANK)
                          ?GAL_FITS_SHORT_BLANK:s[i];}
               while(++i!=size);}
           return;
-       case FLOAT_IMG:
-         sf=(s=*out)+size; do *s=roundf(*iif++); while(++s<sf);
+        case FLOAT_IMG:
+          sf=(s=*out)+size; do *s=roundf(*iif++); while(++s<sf);
           if(anyblank)
             {s=*out; do {s[i]=isnan(iiif[i])?GAL_FITS_SHORT_BLANK:s[i];}
               while(++i!=size);}
           return;
-       case DOUBLE_IMG:
-         sf=(s=*out)+size; do *s=round(*id++); while(++s<sf);
+        case DOUBLE_IMG:
+          sf=(s=*out)+size; do *s=round(*id++); while(++s<sf);
           if(anyblank)
             {s=*out; do {s[i]=isnan(iid[i])?GAL_FITS_SHORT_BLANK:s[i];}
               while(++i!=size);}
           return;
-       default:
-         error(EXIT_FAILURE, 0, "a bug!  In gal_fits_change_type "
-                "(fitsarrayvv.c).  BITPIX=%d of input not recognized.  Please "
-                "contact us so we can fix it", inbitpix);
-       }
+        default:
+          error(EXIT_FAILURE, 0, "a bug!  In gal_fits_change_type "
+                "(fitsarrayvv.c).  BITPIX=%d of input not recognized. "
+                "Please contact us so we can fix it", inbitpix);
+        }
       break;
 
     case LONG_IMG:
       switch(inbitpix)
-       {
-       case BYTE_IMG:
-         lf=(l=*out)+size; do *l=*ib++; while(++l<lf);
+        {
+        case BYTE_IMG:
+          lf=(l=*out)+size; do *l=*ib++; while(++l<lf);
           if(anyblank)
             {l=*out; do {l[i]=(iib[i]==GAL_FITS_BYTE_BLANK)
                          ?GAL_FITS_LONG_BLANK:l[i];}
               while(++i!=size);}
           return;
-       case SHORT_IMG:
-         lf=(l=*out)+size; do *l=*is++; while(++l<lf);
+        case SHORT_IMG:
+          lf=(l=*out)+size; do *l=*is++; while(++l<lf);
           if(anyblank)
             {l=*out; do {l[i]=(iis[i]==GAL_FITS_SHORT_BLANK)
                          ?GAL_FITS_LONG_BLANK:l[i];}
               while(++i!=size);}
           return;
-       case LONG_IMG:
-         lf=(l=*out)+size; do *l=*il++; while(++l<lf); return;
-       case LONGLONG_IMG:
-         lf=(l=*out)+size; do *l=*iL++; while(++l<lf);
+        case LONG_IMG:
+          lf=(l=*out)+size; do *l=*il++; while(++l<lf); return;
+        case LONGLONG_IMG:
+          lf=(l=*out)+size; do *l=*iL++; while(++l<lf);
           if(anyblank)
             {l=*out; do {l[i]=(iiL[i]==GAL_FITS_LLONG_BLANK)
                          ?GAL_FITS_LONG_BLANK:l[i];}
               while(++i!=size);}
           return;
-       case FLOAT_IMG:
-         lf=(l=*out)+size; do *l=roundf(*iif++); while(++l<lf);
+        case FLOAT_IMG:
+          lf=(l=*out)+size; do *l=roundf(*iif++); while(++l<lf);
           if(anyblank)
             {l=*out; do {l[i]=isnan(iiif[i])?GAL_FITS_LONG_BLANK:l[i];}
               while(++i!=size);}
           return;
-       case DOUBLE_IMG:
-         lf=(l=*out)+size; do *l=round(*id++); while(++l<lf);
+        case DOUBLE_IMG:
+          lf=(l=*out)+size; do *l=round(*id++); while(++l<lf);
           if(anyblank)
             {l=*out; do {l[i]=isnan(iid[i])?GAL_FITS_LONG_BLANK:l[i];}
               while(++i!=size);}
           return;
-       default:
-         error(EXIT_FAILURE, 0, "a bug!  In gal_fits_change_type "
-                "(fitsarrayvv.c).  BITPIX=%d of input not recognized.  Please "
-                "contact us so we can fix it", inbitpix);
-       }
+        default:
+          error(EXIT_FAILURE, 0, "a bug!  In gal_fits_change_type "
+                "(fitsarrayvv.c).  BITPIX=%d of input not recognized. "
+                "Please contact us so we can fix it", inbitpix);
+        }
       break;
 
     case LONGLONG_IMG:
       switch(inbitpix)
-       {
-       case BYTE_IMG:
-         Lf=(L=*out)+size; do *L=*ib++; while(++L<Lf);
+        {
+        case BYTE_IMG:
+          Lf=(L=*out)+size; do *L=*ib++; while(++L<Lf);
           if(anyblank)
             {L=*out; do {L[i]=(iib[i]==GAL_FITS_BYTE_BLANK)
                          ?GAL_FITS_LLONG_BLANK:L[i];}
               while(++i!=size);}
           return;
-       case SHORT_IMG:
-         Lf=(L=*out)+size; do *L=*is++; while(++L<Lf);
+        case SHORT_IMG:
+          Lf=(L=*out)+size; do *L=*is++; while(++L<Lf);
           if(anyblank)
             {L=*out; do {L[i]=(iis[i]==GAL_FITS_SHORT_BLANK)
                          ?GAL_FITS_LLONG_BLANK:L[i];}
               while(++i!=size);}
           return;
-       case LONG_IMG:
-         Lf=(L=*out)+size; do *L=*il++; while(++L<Lf);
+        case LONG_IMG:
+          Lf=(L=*out)+size; do *L=*il++; while(++L<Lf);
           if(anyblank)
             {L=*out; do {L[i]=(iil[i]==GAL_FITS_LONG_BLANK)
                          ?GAL_FITS_LLONG_BLANK:L[i];}
               while(++i!=size);}
           return;
-       case LONGLONG_IMG:
-         Lf=(L=*out)+size; do *L=*iL++; while(++L<Lf); return;
-       case FLOAT_IMG:
-         Lf=(L=*out)+size; do *L=roundf(*iif++); while(++L<Lf);
+        case LONGLONG_IMG:
+          Lf=(L=*out)+size; do *L=*iL++; while(++L<Lf); return;
+        case FLOAT_IMG:
+          Lf=(L=*out)+size; do *L=roundf(*iif++); while(++L<Lf);
           if(anyblank)
             {L=*out; do {L[i]=isnan(iiif[i])?GAL_FITS_LLONG_BLANK:L[i];}
               while(++i!=size);}
           return;
-       case DOUBLE_IMG:
-         Lf=(L=*out)+size; do *L=round(*id++); while(++L<Lf);
+        case DOUBLE_IMG:
+          Lf=(L=*out)+size; do *L=round(*id++); while(++L<Lf);
           if(anyblank)
             {L=*out; do {L[i]=isnan(iid[i])?GAL_FITS_LLONG_BLANK:L[i];}
               while(++i!=size);}
           return;
-       default:
-         error(EXIT_FAILURE, 0, "a bug!  In gal_fits_change_type "
-                "(fitsarrayvv.c).  BITPIX=%d of input not recognized.  Please "
-                "contact us so we can fix it", inbitpix);
-       }
+        default:
+          error(EXIT_FAILURE, 0, "a bug!  In gal_fits_change_type "
+                "(fitsarrayvv.c).  BITPIX=%d of input not recognized. "
+                "Please contact us so we can fix it", inbitpix);
+        }
       break;
 
     case FLOAT_IMG:
       switch(inbitpix)
-       {
-       case BYTE_IMG:
-         ff=(f=*out)+size; do *f=*ib++; while(++f<ff);
+        {
+        case BYTE_IMG:
+          ff=(f=*out)+size; do *f=*ib++; while(++f<ff);
           if(anyblank)
             {f=*out; do {f[i]=iib[i]==GAL_FITS_BYTE_BLANK
                          ?GAL_FITS_FLOAT_BLANK:f[i];}
               while(++i!=size);}
           return;
-       case SHORT_IMG:
-         ff=(f=*out)+size; do *f=*is++; while(++f<ff);
+        case SHORT_IMG:
+          ff=(f=*out)+size; do *f=*is++; while(++f<ff);
           if(anyblank)
             {f=*out; do {f[i]=iis[i]==GAL_FITS_SHORT_BLANK
                          ?GAL_FITS_FLOAT_BLANK:f[i];}
               while(++i!=size);}
           return;
-       case LONG_IMG:
-         ff=(f=*out)+size; do *f=*il++; while(++f<ff);
+        case LONG_IMG:
+          ff=(f=*out)+size; do *f=*il++; while(++f<ff);
           if(anyblank)
             {f=*out; do {f[i]=iil[i]==GAL_FITS_LONG_BLANK
                          ?GAL_FITS_FLOAT_BLANK:f[i];}
               while(++i!=size);}
           return;
-       case LONGLONG_IMG:
-         ff=(f=*out)+size; do *f=*iL++; while(++f<ff);
+        case LONGLONG_IMG:
+          ff=(f=*out)+size; do *f=*iL++; while(++f<ff);
           if(anyblank)
             {f=*out; do {f[i]=iiL[i]==GAL_FITS_LLONG_BLANK
                          ?GAL_FITS_FLOAT_BLANK:f[i];}
               while(++i!=size);}
           return;
-       case FLOAT_IMG:
-         ff=(f=*out)+size; do *f=*iif++; while(++f<ff); return;
-       case DOUBLE_IMG:
-         ff=(f=*out)+size; do *f=*id++; while(++f<ff); return;
-       default:
-         error(EXIT_FAILURE, 0, "a bug!  In gal_fits_change_type "
-                "(fitsarrayvv.c).  BITPIX=%d of input not recognized.  Please "
-                "contact us so we can fix it", inbitpix);
-       }
+        case FLOAT_IMG:
+          ff=(f=*out)+size; do *f=*iif++; while(++f<ff); return;
+        case DOUBLE_IMG:
+          ff=(f=*out)+size; do *f=*id++; while(++f<ff); return;
+        default:
+          error(EXIT_FAILURE, 0, "a bug!  In gal_fits_change_type "
+                "(fitsarrayvv.c).  BITPIX=%d of input not recognized. "
+                "Please contact us so we can fix it", inbitpix);
+        }
       break;
 
     case DOUBLE_IMG:
       switch(inbitpix)
-       {
-       case BYTE_IMG:
-         df=(d=*out)+size; do *d=*ib++; while(++d<df);
+        {
+        case BYTE_IMG:
+          df=(d=*out)+size; do *d=*ib++; while(++d<df);
           if(anyblank)
             {d=*out; do {d[i]=iib[i]==GAL_FITS_BYTE_BLANK
                          ?GAL_FITS_FLOAT_BLANK:d[i];}
               while(++i!=size);}
           return;
-       case SHORT_IMG:
-         df=(d=*out)+size; do *d=*is++; while(++d<df);
+        case SHORT_IMG:
+          df=(d=*out)+size; do *d=*is++; while(++d<df);
           if(anyblank)
             {d=*out; do {d[i]=iis[i]==GAL_FITS_SHORT_BLANK
                          ?GAL_FITS_FLOAT_BLANK:d[i];}
               while(++i!=size);}
           return;
-       case LONG_IMG:
-         df=(d=*out)+size; do *d=*il++; while(++d<df);
+        case LONG_IMG:
+          df=(d=*out)+size; do *d=*il++; while(++d<df);
           if(anyblank)
             {d=*out; do {d[i]=iil[i]==GAL_FITS_LONG_BLANK
                          ?GAL_FITS_FLOAT_BLANK:d[i];}
               while(++i!=size);}
           return;
-       case LONGLONG_IMG:
-         df=(d=*out)+size; do *d=*iL++; while(++d<df);
+        case LONGLONG_IMG:
+          df=(d=*out)+size; do *d=*iL++; while(++d<df);
           if(anyblank)
             {d=*out; do {d[i]=iiL[i]==GAL_FITS_LLONG_BLANK
                          ?GAL_FITS_FLOAT_BLANK:d[i];}
               while(++i!=size);}
           return;
-       case FLOAT_IMG:
-         df=(d=*out)+size; do *d=*iif++; while(++d<df); return;
-       case DOUBLE_IMG:
-         df=(d=*out)+size; do *d=*id++; while(++d<df); return;
-       default:
-         error(EXIT_FAILURE, 0, "a bug!  In gal_fits_change_type "
-                "(fitsarrayvv.c).  BITPIX=%d of input not recognized.  Please "
-                "contact us so we can fix it", inbitpix);
-       }
+        case FLOAT_IMG:
+          df=(d=*out)+size; do *d=*iif++; while(++d<df); return;
+        case DOUBLE_IMG:
+          df=(d=*out)+size; do *d=*id++; while(++d<df); return;
+        default:
+          error(EXIT_FAILURE, 0, "a bug!  In gal_fits_change_type "
+                "(fitsarrayvv.c).  BITPIX=%d of input not recognized. "
+                "Please contact us so we can fix it", inbitpix);
+        }
       break;
 
 
     default:
       error(EXIT_FAILURE, 0, "a bug! Output Bitpix value of %d is not "
-           "recognized. This should not happen here "
+            "recognized. This should not happen here "
             "(gal_fits_change_type in fitsarrayvv.c). Please "
             "contact us to see how this happened", outbitpix);
     }
@@ -718,7 +721,7 @@ hdutypestring(int hdutype)
       break;
     default:
       error(EXIT_FAILURE, 0, "HDU code %d in CFITSIO not recognized",
-           hdutype);
+            hdutype);
     }
   return NULL;
 }
@@ -757,8 +760,8 @@ gal_fits_read_hdu(char *filename, char *hdu, int 
desiredtype,
 
   if(hdutype!=desiredtype)
     error(EXIT_FAILURE, 0, "%s: HDU %s is %s, not %s",
-         filename, hdu, hdutypestring(hdutype),
-         hdutypestring(desiredtype));
+          filename, hdu, hdutypestring(hdutype),
+          hdutypestring(desiredtype));
 
   free(ffname);
 }
@@ -865,9 +868,9 @@ gal_fits_read_keywords(char *filename, char *hdu,
    not. If not, they don't need to be freed. */
 void
 gal_fits_add_to_fits_header_ll(struct gal_fits_header_ll **list,
-                                    int datatype, char *keyname, int kfree,
-                                    void *value, int vfree, char *comment,
-                                    int cfree, char *unit)
+                               int datatype, char *keyname, int kfree,
+                               void *value, int vfree, char *comment,
+                               int cfree, char *unit)
 {
   struct gal_fits_header_ll *newnode;
 
@@ -876,13 +879,13 @@ gal_fits_add_to_fits_header_ll(struct gal_fits_header_ll 
**list,
   newnode=malloc(sizeof *newnode);
   if(newnode==NULL)
     error(EXIT_FAILURE, errno,
-         "linkedlist: new element in gal_fits_header_ll");
+          "linkedlist: new element in gal_fits_header_ll");
   newnode->datatype=datatype;
   newnode->keyname=keyname;
   newnode->value=value;
   newnode->comment=comment;
   newnode->unit=unit;
-  newnode->kfree=kfree;                /* Free pointers after using them. */
+  newnode->kfree=kfree;                /* Free pointers after using them. */
   newnode->vfree=vfree;
   newnode->cfree=cfree;
 
@@ -896,9 +899,9 @@ gal_fits_add_to_fits_header_ll(struct gal_fits_header_ll 
**list,
 
 void
 gal_fits_add_to_fits_header_ll_end(struct gal_fits_header_ll **list,
-                                        int datatype, char *keyname, int kfree,
-                                        void *value, int vfree, char *comment,
-                                        int cfree, char *unit)
+                                   int datatype, char *keyname, int kfree,
+                                   void *value, int vfree, char *comment,
+                                   int cfree, char *unit)
 {
   struct gal_fits_header_ll *newnode, *tmp;
 
@@ -907,24 +910,24 @@ gal_fits_add_to_fits_header_ll_end(struct 
gal_fits_header_ll **list,
   newnode=malloc(sizeof *newnode);
   if(newnode==NULL)
     error(EXIT_FAILURE, errno,
-         "linkedlist: new element in gal_fits_header_ll");
+          "linkedlist: new element in gal_fits_header_ll");
   newnode->datatype=datatype;
   newnode->keyname=keyname;
   newnode->value=value;
   newnode->comment=comment;
   newnode->unit=unit;
-  newnode->kfree=kfree;                /* Free pointers after using them. */
+  newnode->kfree=kfree;            /* Free pointers after using them. */
   newnode->vfree=vfree;
   newnode->cfree=cfree;
 
-  if(*list)     /* List is already full, add this node to the end */
+  if(*list)         /* List is already full, add this node to the end */
     {
       /* After this line, tmp points to the last node. */
       tmp=*list; while(tmp->next!=NULL) tmp=tmp->next;
       tmp->next=newnode;
       newnode->next=NULL;
     }
-  else          /* List is empty */
+  else                 /* List is empty */
     {
       newnode->next=*list;
       *list=newnode;
@@ -956,7 +959,7 @@ gal_fits_file_name_in_keywords(char *keynamebase, char 
*filename,
       errno=0;
       keyname=malloc(FLEN_KEYWORD);
       if(keyname==NULL)
-       error(EXIT_FAILURE, errno, "%d bytes", FLEN_KEYWORD);
+        error(EXIT_FAILURE, errno, "%d bytes", FLEN_KEYWORD);
       sprintf(keyname, "%s_%lu", keynamebase, numkey++);
 
       /* Set the keyword value: */
@@ -964,41 +967,41 @@ gal_fits_file_name_in_keywords(char *keynamebase, char 
*filename,
       thislen=strlen(&filename[i]);
       value=malloc(maxlength);
       if(value==NULL)
-       error(EXIT_FAILURE, errno, "%lu bytes", thislen);
+        error(EXIT_FAILURE, errno, "%lu bytes", thislen);
       strncpy(value, &filename[i], maxlength);
 
       /* If the FROM string (=&filename[i]) in strncpy is shorter than
-        SIZE (=maxlength), then the rest of the space will be filled
-        with null characters. So we can use this to check if the full
-        length was copied. */
+         SIZE (=maxlength), then the rest of the space will be filled
+         with null characters. So we can use this to check if the full
+         length was copied. */
       if(value[maxlength-1]=='\0')
-       {
-         gal_fits_add_to_fits_header_ll_end(list, TSTRING, keyname, 1,
-                                                  value, 1, NULL, 0, NULL);
-         break;
-       }
+        {
+          gal_fits_add_to_fits_header_ll_end(list, TSTRING, keyname, 1,
+                                             value, 1, NULL, 0, NULL);
+          break;
+        }
       else
-       {
-         /* Find the last place in the copied array that contains a
-            '/' and put j on the next character (so it can be turned
-            into a null character.*/
-         for(j=maxlength-1;j>0;--j)
-           if(value[j]=='/')
-             {
-               value[j+1]='\0';
-               break;
-             }
-         if(j==0)
-           error(EXIT_FAILURE, 0, "the filename `%sP has at least one span "
-                 "of %lu characters without a `/`. It cannot be written "
-                 "to the header of the output fits file", filename,
-                 maxlength);
-
-         /* Convert the last useful character and save the file name.*/
-         gal_fits_add_to_fits_header_ll_end(list, TSTRING, keyname, 1,
-                                                  value, 1, NULL, 0, NULL);
-         i+=j+1;
-       }
+        {
+          /* Find the last place in the copied array that contains a
+             '/' and put j on the next character (so it can be turned
+             into a null character.*/
+          for(j=maxlength-1;j>0;--j)
+            if(value[j]=='/')
+              {
+                value[j+1]='\0';
+                break;
+              }
+          if(j==0)
+            error(EXIT_FAILURE, 0, "the filename `%sP has at least one "
+                  "span of %lu characters without a `/`. It cannot be "
+                  "written to the header of the output fits file",
+                  filename, maxlength);
+
+          /* Convert the last useful character and save the file name.*/
+          gal_fits_add_to_fits_header_ll_end(list, TSTRING, keyname, 1,
+                                             value, 1, NULL, 0, NULL);
+          i+=j+1;
+        }
     }
 }
 
@@ -1057,18 +1060,19 @@ gal_fits_update_keys(fitsfile *fptr,
       /* Write the information: */
       if(tmp->value)
         {
-          if( fits_update_key(fptr, tmp->datatype, tmp->keyname, tmp->value,
-                              tmp->comment, &status) )
+          if( fits_update_key(fptr, tmp->datatype, tmp->keyname,
+                              tmp->value, tmp->comment, &status) )
             gal_fits_io_error(status, NULL);
         }
       else
         {
-          if(fits_update_key_null(fptr, tmp->keyname, tmp->comment, &status))
+          if(fits_update_key_null(fptr, tmp->keyname, tmp->comment,
+                                  &status))
             gal_fits_io_error(status, NULL);
         }
       if(tmp->unit && fits_write_key_unit(fptr, tmp->keyname,
-                                         tmp->unit, &status) )
-       gal_fits_io_error(status, NULL);
+                                          tmp->unit, &status) )
+        gal_fits_io_error(status, NULL);
 
       /* Free the value pointer if desired: */
       if(tmp->kfree) free(tmp->keyname);
@@ -1076,7 +1080,7 @@ gal_fits_update_keys(fitsfile *fptr,
       if(tmp->cfree) free(tmp->comment);
 
       /* Keep the pointer to the next keyword and free the allocated
-        space for this keyword.*/
+         space for this keyword.*/
       ttmp=tmp->next;
       free(tmp);
       tmp=ttmp;
@@ -1132,15 +1136,15 @@ gal_fits_copyright_end(fitsfile *fptr,
   /* Write all the information: */
   fits_write_date(fptr, &status);
   fits_update_key(fptr, TSTRING, "CFITSIO", cfitsioversion,
-                 "CFITSIO version.", &status);
+                  "CFITSIO version.", &status);
 #ifdef HAVE_WCSLIBVERSION
   wcslibversion_const=wcslib_version(wcslibvers);
   strcpy(wcslibversion, wcslibversion_const);
   fits_update_key(fptr, TSTRING, "WCSLIB", wcslibversion,
-                 "WCSLIB version.", &status);
+                  "WCSLIB version.", &status);
 #endif
   fits_update_key(fptr, TSTRING, "GNUASTRO", PACKAGE_VERSION,
-                 "GNU Astronomy Utilities version.", &status);
+                  "GNU Astronomy Utilities version.", &status);
   fits_write_comment(fptr, PACKAGE_STRING, &status);
   fits_write_comment(fptr, PACKAGE_URL, &status);
   /*
@@ -1260,7 +1264,7 @@ gal_fits_read_wcs_from_pointer(fitsfile *fptr, int *nwcs,
   /* Initialize the wcsprm struct
   if ((status = wcsset(*wcs)))
     error(EXIT_FAILURE, 0, "wcsset ERROR %d: %s.\n", status,
-         wcs_errmsg[status]);
+          wcs_errmsg[status]);
   */
 }
 
@@ -1319,8 +1323,8 @@ gal_fits_hdu_to_array(char *filename, char *hdu, int 
*bitpix,
   *array=gal_fits_bitpix_alloc(*s0 * *s1, *bitpix);
 
   /* Read the image into the allocated array: */
-  fits_read_pix(fptr, gal_fits_bitpix_to_dtype(*bitpix), fpixel, *s0 * *s1,
-               bitblank, *array, &anyblank, &status);
+  fits_read_pix(fptr, gal_fits_bitpix_to_dtype(*bitpix), fpixel,
+                *s0 * *s1, bitblank, *array, &anyblank, &status);
   if(status) gal_fits_io_error(status, NULL);
   free(bitblank);
 
@@ -1398,8 +1402,8 @@ gal_fits_array_to_file(char *filename, char *hdu, int 
bitpix,
       /* Convert the WCS information to text. */
       status=wcshdo(WCSHDO_safe, wcs, &nkeyrec, &wcsheader);
       if(status)
-       error(EXIT_FAILURE, 0, "wcshdo ERROR %d: %s", status,
-             wcs_errmsg[status]);
+        error(EXIT_FAILURE, 0, "wcshdo ERROR %d: %s", status,
+              wcs_errmsg[status]);
       gal_fits_add_wcs_to_header(fptr, wcsheader, nkeyrec);
     }
 
@@ -1445,11 +1449,13 @@ gal_fits_atof_correct_wcs(char *filename, char *hdu, 
int bitpix,
     {
       gal_fits_add_wcs_to_header(fptr, wcsheader, wcsnkeyrec);
       if(crpix)
-       {
-         fits_update_key(fptr, TDOUBLE, "CRPIX1", &crpix[0], NULL, &status);
-         fits_update_key(fptr, TDOUBLE, "CRPIX2", &crpix[1], NULL, &status);
-         gal_fits_io_error(status, NULL);
-       }
+        {
+          fits_update_key(fptr, TDOUBLE, "CRPIX1", &crpix[0],
+                          NULL, &status);
+          fits_update_key(fptr, TDOUBLE, "CRPIX2", &crpix[1],
+                          NULL, &status);
+          gal_fits_io_error(status, NULL);
+        }
     }
 
   gal_fits_copyright_end(fptr, NULL, spack_string);
@@ -1499,10 +1505,10 @@ gal_fits_file_or_ext_name(char *inputname, char *inhdu, 
int othernameset,
         error(EXIT_FAILURE, 0, "a %s image was specified (%s). However, "
               "no HDU is given for it. Please add a HDU. If you regularly "
               "use the same HDU as %s, you may consider adding it to "
-              "the configuration file. For more information, please see the "
-              "`Configuration files' section of the %s manual by running "
-              "` info gnuastro ' on the command-line", type, *othername,
-              type, PACKAGE_NAME);
+              "the configuration file. For more information, please see "
+              "the `Configuration files' section of the %s manual by "
+              "running ` info gnuastro ' on the command-line", type,
+              *othername, type, PACKAGE_NAME);
       if(strcmp(inputname, *othername)==0)
         {
           if(strcmp(ohdu, inhdu)==0)
@@ -1564,8 +1570,8 @@ gal_fits_file_to_float(char *inputname, char *maskname, 
char *inhdu,
                 "image is usually an integer type. Therefore this might "
                 "be due to a mistake in the inputs and the results might "
                 "not be what you intended. However, the program will not "
-                "abort and continue working only with zero valued pixels in "
-                "the given masked image.", maskname, mhdu,
+                "abort and continue working only with zero valued pixels "
+                "in the given masked image.", maskname, mhdu,
                 maskbitpix==FLOAT_IMG ? "single" : "double", maskbitpix);
 
       if(s0!=*ins0 || s1!=*ins1)
@@ -1579,7 +1585,7 @@ gal_fits_file_to_float(char *inputname, char *maskname, 
char *inhdu,
       else
         {
           gal_fits_change_type(array, maskbitpix, *ins0 * *ins1,
-                                    maskanyblank, (void **)(&mask), FLOAT_IMG);
+                               maskanyblank, (void **)(&mask), FLOAT_IMG);
           free(array);
         }
 
diff --git a/lib/gnuastro/box.h b/lib/gnuastro/box.h
index 6277fd7..e702979 100644
--- a/lib/gnuastro/box.h
+++ b/lib/gnuastro/box.h
@@ -24,7 +24,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #define __GAL_BOX_H__
 
 /*                        IMPORTANT NOTE:
-        All the axises are based on the FITS standard, NOT C.
+         All the axises are based on the FITS standard, NOT C.
 */
 
 void
diff --git a/lib/gnuastro/checkset.h b/lib/gnuastro/checkset.h
index 712b144..61a10ba 100644
--- a/lib/gnuastro/checkset.h
+++ b/lib/gnuastro/checkset.h
@@ -31,19 +31,19 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 /*********                 Macros                **************/
 /**************************************************************/
 #define GAL_CHECKSET_CHECK_COL_IN_CAT(INCOL,NAME) {                     \
-    size_t i;                                                          \
+    size_t i;                                                           \
                                                                         \
-    if( (INCOL) >= p->cs1 )                                            \
-      error(EXIT_FAILURE, 0, "%s only has %lu columns while you "      \
-           "have requested column %lu (counting from zero) for "       \
-           "`--%s`", p->up.catname, p->cs1, (INCOL), (NAME));          \
-                                                                       \
-    for(i=0;i<p->cs0;++i)                                              \
-      if( isnan(p->cat[i*p->cs1+(INCOL)]) )                            \
-       error(EXIT_FAILURE, 0, "%s: column %lu (--%s) in row %lu "      \
-             "could not be read as a number. See %s. Note that "       \
-             "counting starts from zero",                              \
-             p->up.catname, (INCOL), (NAME), i, GAL_TXTARRAY_LOG);     \
+    if( (INCOL) >= p->cs1 )                                             \
+      error(EXIT_FAILURE, 0, "%s only has %lu columns while you "       \
+            "have requested column %lu (counting from zero) for "       \
+            "`--%s`", p->up.catname, p->cs1, (INCOL), (NAME));          \
+                                                                        \
+    for(i=0;i<p->cs0;++i)                                               \
+      if( isnan(p->cat[i*p->cs1+(INCOL)]) )                             \
+        error(EXIT_FAILURE, 0, "%s: column %lu (--%s) in row %lu "      \
+              "could not be read as a number. See %s. Note that "       \
+              "counting starts from zero",                              \
+              p->up.catname, (INCOL), (NAME), i, GAL_TXTARRAY_LOG);     \
   }
 
 
@@ -88,29 +88,29 @@ gal_checkset_int_zero_or_one(char *optarg, int *var, char 
*lo, char so,
                              char* spack, char *filename, size_t lineno);
 
 void
-gal_checkset_int_4_or_8(char *optarg, int *var, char *lo, char so, char *spack,
-                        char *filename, size_t lineno);
+gal_checkset_int_4_or_8(char *optarg, int *var, char *lo, char so,
+                        char *spack, char *filename, size_t lineno);
 
 void
-gal_checkset_int_el_zero(char *optarg, int *var, char *lo, char so, char 
*spack,
-                         char *filename, size_t lineno);
+gal_checkset_int_el_zero(char *optarg, int *var, char *lo, char so,
+                         char *spack, char *filename, size_t lineno);
 
 void
-gal_checkset_int_l_zero(char *optarg, int *var, char *lo, char so, char *spack,
-                        char *filename, size_t lineno);
+gal_checkset_int_l_zero(char *optarg, int *var, char *lo, char so,
+                        char *spack, char *filename, size_t lineno);
 
 void
-gal_checkset_int_smaller_equal_to(char *optarg, int *var, char *lo, char so,
-                                  char *spack, char *filename, size_t lineno,
-                                  long maxvalue);
+gal_checkset_int_smaller_equal_to(char *optarg, int *var, char *lo,
+                                  char so, char *spack, char *filename,
+                                  size_t lineno, long maxvalue);
 
 void
 gal_checkset_long_el_zero(char *optarg, long *var, char *lo, char so,
                           char *spack, char *filename, size_t lineno);
 
 void
-gal_checkset_any_long(char *optarg, long *var, char *lo, char so, char *spack,
-                      char *filename, size_t lineno);
+gal_checkset_any_long(char *optarg, long *var, char *lo, char so,
+                      char *spack, char *filename, size_t lineno);
 
 void
 gal_checkset_sizet_el_zero(char *optarg, size_t *var, char *lo, char so,
@@ -125,16 +125,16 @@ gal_checkset_sizet_p_odd(char *optarg, size_t *var, char 
*lo, char so,
                          char* spack, char *filename, size_t lineno);
 
 void
-gal_checkset_float_l_0(char *optarg, float *var, char *lo, char so, char 
*spack,
-                       char *filename, size_t lineno);
+gal_checkset_float_l_0(char *optarg, float *var, char *lo, char so,
+                       char *spack, char *filename, size_t lineno);
 
 void
 gal_checkset_float_l_0_s_1(char *optarg, float *var, char *lo, char so,
                            char *spack, char *filename, size_t lineno);
 
 void
-gal_checkset_any_float(char *optarg, float *var, char *lo, char so, char 
*spack,
-                       char *filename, size_t lineno);
+gal_checkset_any_float(char *optarg, float *var, char *lo, char so,
+                       char *spack, char *filename, size_t lineno);
 
 void
 gal_checkset_double_l_0(char *optarg, double *var, char *lo, char so,
@@ -197,8 +197,9 @@ int
 gal_checkset_dir_0_file_1(char *name, int dontdelete);
 
 void
-gal_checkset_automatic_output(char *inname, char *suffix, int removedirinfo,
-                              int dontdelete, char **outname);
+gal_checkset_automatic_output(char *inname, char *suffix,
+                              int removedirinfo, int dontdelete,
+                              char **outname);
 
 char *
 gal_checkset_dir_part(char *input);
diff --git a/lib/gnuastro/commonargs.h b/lib/gnuastro/commonargs.h
index c696f2a..7d85c60 100644
--- a/lib/gnuastro/commonargs.h
+++ b/lib/gnuastro/commonargs.h
@@ -207,9 +207,9 @@ gal_checkset_commonargs_cparse_opt(int key, char *arg, 
struct argp_state *state)
      user is warned and the program is stopped: */
   if(arg && arg[0]=='=')
     argp_error(state, "incorrect use of the equal sign (`=`). For short "
-              "options, `=` should not be used and for long options, "
-              "there should be no space between the option, equal sign "
-              "and value");
+               "options, `=` should not be used and for long options, "
+               "there should be no space between the option, equal sign "
+               "and value");
 
   switch(key)
     {
@@ -259,8 +259,8 @@ gal_checkset_commonargs_cparse_opt(int key, char *arg, 
struct argp_state *state)
       cp->output=malloc(strlen(arg)+1);
       if(cp->output==NULL) error(EXIT_FAILURE, 0, "space for output");
       strcpy(cp->output, arg); /* This allocation is done so cp->output */
-      cp->outputset=1;        /* Can always be freed when set, because */
-      break;                  /* It usually needs modifications.       */
+      cp->outputset=1;         /* Can always be freed when set, because */
+      break;                   /* It usually needs modifications.       */
     case 'D':
       cp->dontdelete=1;
       break;
@@ -272,9 +272,9 @@ gal_checkset_commonargs_cparse_opt(int key, char *arg, 
struct argp_state *state)
     /* Once finished: */
     case ARGP_KEY_END:
       if(cp->setdirconf && cp->setusrconf)
-       error(EXIT_FAILURE, 0, "only one of `--setusrconf` or "
-             "`--setdirconf` may be set in each run. You have asked "
-             "for both");
+        error(EXIT_FAILURE, 0, "only one of `--setusrconf` or "
+              "`--setdirconf` may be set in each run. You have asked "
+              "for both");
       break;
 
     /* If the argument is not known. */
diff --git a/lib/gnuastro/configfiles.h b/lib/gnuastro/configfiles.h
index 94f1ad1..113650d 100644
--- a/lib/gnuastro/configfiles.h
+++ b/lib/gnuastro/configfiles.h
@@ -34,11 +34,11 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 #define GAL_CONFIGFILES_START_READING_LINE {                            \
-  ++lineno;                                                            \
-  if(*line=='#') continue;                                             \
+    ++lineno;                                                           \
+  if(*line=='#') continue;                                              \
   else gal_configfiles_read_name_value(line, filename, lineno,          \
                                        &name, &value);                  \
-  if(name==NULL && value==NULL) continue;                              \
+  if(name==NULL && value==NULL) continue;                               \
 }
 
 
@@ -47,23 +47,23 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
    depend on functions that are different for different programs. So
    they have to be written into the functions with a macro. */
 #define GAL_CONFIGFILES_SAVE_LOCAL_CONFIG(INDIR) {                      \
-    FILE *fp;                                                          \
-    char *outfilename, *command;                                       \
+    FILE *fp;                                                           \
+    char *outfilename, *command;                                        \
     fp=gal_configfiles_write_local_config_stop(INDIR, CONFIG_FILE,      \
                                                SPACK, SPACK_NAME,       \
                                                &outfilename);           \
-    printvalues(fp, p);                                                        
\
-    errno=0;                                                           \
-    if(fclose(fp)==-1)                                                 \
+    printvalues(fp, p);                                                 \
+    errno=0;                                                            \
+    if(fclose(fp)==-1)                                                  \
       error(EXIT_FAILURE, errno, "%s", outfilename);                    \
     command=gal_checkset_malloc_cat("cat ", outfilename);               \
-    printf("Values saved in %s:\n\n", outfilename);                    \
+    printf("Values saved in %s:\n\n", outfilename);                     \
     if(system(command))                                                 \
       error(EXIT_FAILURE, 0, "the `%s` command could not be run or "    \
             "failed", command);                                         \
-    free(outfilename);                                                 \
-    free(command);                                                     \
-    exit(EXIT_SUCCESS);                                                        
\
+    free(outfilename);                                                  \
+    free(command);                                                      \
+    exit(EXIT_SUCCESS);                                                 \
   }
 
 
@@ -71,7 +71,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 #define GAL_CONFIGFILES_CHECK_SET_CONFIG {                              \
-    char *userconfig_dir, *userconfig_file;                            \
+    char *userconfig_dir, *userconfig_file;                             \
                                                                         \
     readconfig(CURDIRCONFIG_FILE, p);                                   \
     if(cp->setdirconf)                                                  \
@@ -100,8 +100,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
         if(cp->setusrconf)                                              \
           GAL_CONFIGFILES_SAVE_LOCAL_CONFIG(userconfig_dir);            \
         readconfig(SYSCONFIG_FILE, p);                                  \
-        free(userconfig_file);                                         \
-        free(userconfig_dir);                                          \
+        free(userconfig_file);                                                \
+        free(userconfig_dir);                                                \
       }                                                                 \
   }
 
@@ -112,13 +112,13 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 #define GAL_CONFIGFILES_REPORT_NOTSET(var_name) {                       \
-    if(intro==0)                                                       \
-      {                                                                        
\
-       fprintf(stderr, SPACK": Parameter(s) not set: %s", (var_name)); \
-       intro=1;                                                        \
-      }                                                                        
\
-    else                                                               \
-      fprintf(stderr, ", %s", (var_name));                             \
+    if(intro==0)                                                        \
+      {                                                                 \
+        fprintf(stderr, SPACK": Parameter(s) not set: %s", (var_name)); \
+        intro=1;                                                        \
+      }                                                                 \
+    else                                                                \
+      fprintf(stderr, ", %s", (var_name));                              \
   }
 
 
@@ -126,22 +126,22 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 #define GAL_CONFIGFILES_END_OF_NOTSET_REPORT {                          \
-    if(intro)                                                          \
-      {                                                                        
\
-       char *userconfig_file;                                          \
-       fprintf(stderr, ".\n\n");                                       \
-       fprintf(stderr, "You can assign values in the local, user or "  \
-               "system wide default files. Otherwise you have to "     \
-               "explicitly call them each time. See `"SPACK" --help` " \
-               "or `info "SPACK"` for more information.\n\n");         \
-       userconfig_file=                                                \
+    if(intro)                                                           \
+      {                                                                 \
+        char *userconfig_file;                                          \
+        fprintf(stderr, ".\n\n");                                       \
+        fprintf(stderr, "You can assign values in the local, user or "  \
+                "system wide default files. Otherwise you have to "     \
+                "explicitly call them each time. See `"SPACK" --help` " \
+                "or `info "SPACK"` for more information.\n\n");         \
+        userconfig_file=                                                \
         gal_configfiles_add_home_dir(USERCONFIG_FILEEND);               \
-       fprintf(stderr, "Default files checked (existing or not):\n"    \
-               "   %s\n   %s\n   %s\n", CURDIRCONFIG_FILE,             \
-               userconfig_file, SYSCONFIG_FILE);                       \
-       free(userconfig_file);                                          \
-       exit(EXIT_FAILURE);                                             \
-      }                                                                        
\
+        fprintf(stderr, "Default files checked (existing or not):\n"    \
+                "   %s\n   %s\n   %s\n", CURDIRCONFIG_FILE,             \
+                userconfig_file, SYSCONFIG_FILE);                       \
+        free(userconfig_file);                                          \
+        exit(EXIT_FAILURE);                                             \
+      }                                                                 \
   }
 
 
@@ -149,11 +149,11 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 
 #define GAL_CONFIGFILES_REPORT_PARAMETERS_SET {                         \
-    fprintf(stdout, "# "SPACK_STRING"\n");                             \
-    fprintf(stdout, "# Configured on "CONFIGDATE" at "CONFIGTIME"\n"); \
-    fprintf(stdout, "# Written on %s", ctime(&p->rawtime));            \
-    printvalues(stdout, p);                                            \
-    exit(EXIT_SUCCESS);                                                        
\
+    fprintf(stdout, "# "SPACK_STRING"\n");                              \
+    fprintf(stdout, "# Configured on "CONFIGDATE" at "CONFIGTIME"\n");  \
+    fprintf(stdout, "# Written on %s", ctime(&p->rawtime));             \
+    printvalues(stdout, p);                                             \
+    exit(EXIT_SUCCESS);                                                 \
   }
 
 
diff --git a/lib/gnuastro/fixedstringmacros.h b/lib/gnuastro/fixedstringmacros.h
index 74033bb..b46919b 100644
--- a/lib/gnuastro/fixedstringmacros.h
+++ b/lib/gnuastro/fixedstringmacros.h
@@ -24,69 +24,70 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #define __GAL_COPYRIGHT_H__
 
 
-#define GAL_STRINGS_SHORT_COPYRIGHT                                      \
+#define GAL_STRINGS_SHORT_COPYRIGHT                                     \
   "Copyright (C) 2015-2016, Free Software Foundation, Inc."
 
 
-#define GAL_STRINGS_SHORT_LICENSE                                        \
+#define GAL_STRINGS_SHORT_LICENSE                                       \
   "License GPLv3+: GNU General public license version 3 or later."
 
 
-#define GAL_STRINGS_COPYRIGHT                                            \
-  GAL_STRINGS_SHORT_COPYRIGHT"\n"GAL_STRINGS_SHORT_LICENSE"\n"           \
-  "This is free software: you are free to change and redistribute it.\n" \
-  "There is NO WARRANTY, to the extent permitted by law."               \
+#define GAL_STRINGS_COPYRIGHT                                           \
+  GAL_STRINGS_SHORT_COPYRIGHT"\n"GAL_STRINGS_SHORT_LICENSE"\n"          \
+  "This is free software: you are free to change and redistribute "     \
+  "it.\nThere is NO WARRANTY, to the extent permitted by law."          \
 
 
-#define GAL_STRINGS_TOP_HELP_INFO                                        \
+#define GAL_STRINGS_TOP_HELP_INFO                                       \
   "\n"SPACK_NAME" is part of "PACKAGE_STRING".\n"
 
 
 
 /* This is fixed for all the packages. */
-#define GAL_STRINGS_MORE_HELP_INFO                                       \
-  "\nFor more information, please run any of the "                       \
-  "following commands. They will respectively show you the `Invoking "  \
-  SPACK_NAME"' subsection, the complete `"SPACK_NAME"' section, or the " \
-  "full "PACKAGE_NAME" manual. In particular the first contains "        \
-  "a very complete explanation of each option.\n\n"                      \
-  "     info "SPACK"\n\n"                                                \
-  "     info "SPACK_NAME"\n\n"                                          \
-  "     info "PACKAGE_TARNAME"\n\n"                                      \
-  "If you couldn't find your answer in the manual, you can get "         \
-  "direct help from experienced Gnuastro users and developers. "         \
-  "For more information, please run:\n\n"                                \
-  "     info help-gnuastro\n\n"                                          \
-  SPACK_NAME" options:"                                                  \
-
-
-
-#define GAL_STRINGS_MAIN_BIBTEX                                          \
-  "@ARTICLE{noisechisel,\n"                                              \
-  "   author = {{Akhlaghi}, M. and {Ichikawa}, T.},\n"                   \
-  "    title = \"{Noise-based Detection and Segmentation of Nebulous 
Objects}\",\n" \
-  "  journal = {\\apjs},\n"                                              \
-  "archivePrefix = \"arXiv\",\n"                                         \
-  "   eprint = {1505.01664},\n"                                          \
-  " primaryClass = \"astro-ph.IM\",\n"                                   \
-  " keywords = {galaxies: irregular, galaxies: photometry, "             \
-  "galaxies: structure, methods: data analysis, "                        \
-  "techniques: image processing, techniques: photometric},\n"            \
-  "     year = 2015,\n"                                                  \
-  "    month = sep,\n"                                                   \
-  "   volume = 220,\n"                                                   \
-  "      eid = {1},\n"                                                   \
-  "    pages = {1},\n"                                                   \
-  "      doi = {10.1088/0067-0049/220/1/1},\n"                           \
-  "   adsurl = {http://adsabs.harvard.edu/abs/2015ApJS..220....1A},\n";   \
-  "  adsnote = {Provided by the SAO/NASA Astrophysics Data System}\n"    \
+#define GAL_STRINGS_MORE_HELP_INFO                                      \
+  "\nFor more information, please run any of the "                      \
+  "following commands. They will respectively show you the `Invoking "  \
+  SPACK_NAME"' subsection, the complete `"SPACK_NAME"' section, or "    \
+  "the full "PACKAGE_NAME" manual. In particular the first contains "   \
+  "a very complete explanation of each option.\n\n"                     \
+  "     info "SPACK"\n\n"                                               \
+  "     info "SPACK_NAME"\n\n"                                          \
+  "     info "PACKAGE_TARNAME"\n\n"                                     \
+  "If you couldn't find your answer in the manual, you can get "        \
+  "direct help from experienced Gnuastro users and developers. "        \
+  "For more information, please run:\n\n"                               \
+  "     info help-gnuastro\n\n"                                         \
+  SPACK_NAME" options:"                                                 \
+
+
+
+#define GAL_STRINGS_MAIN_BIBTEX                                         \
+  "@ARTICLE{noisechisel,\n"                                             \
+  "   author = {{Akhlaghi}, M. and {Ichikawa}, T.},\n"                  \
+  "    title = \"{Noise-based Detection and Segmentation of Nebulous "  \
+  "Objects}\",\n"                                                       \
+  "  journal = {\\apjs},\n"                                             \
+  "archivePrefix = \"arXiv\",\n"                                        \
+  "   eprint = {1505.01664},\n"                                         \
+  " primaryClass = \"astro-ph.IM\",\n"                                  \
+  " keywords = {galaxies: irregular, galaxies: photometry, "            \
+  "galaxies: structure, methods: data analysis, "                       \
+  "techniques: image processing, techniques: photometric},\n"           \
+  "     year = 2015,\n"                                                 \
+  "    month = sep,\n"                                                  \
+  "   volume = 220,\n"                                                  \
+  "      eid = {1},\n"                                                  \
+  "    pages = {1},\n"                                                  \
+  "      doi = {10.1088/0067-0049/220/1/1},\n"                          \
+  "   adsurl = {http://adsabs.harvard.edu/abs/2015ApJS..220....1A},\n";  \
+  "  adsnote = {Provided by the SAO/NASA Astrophysics Data System}\n"   \
   "}"
 
 
 /* This can be used in the end of error messages related to option
    values. */
-#define GAL_STRINGS_HOW_TO_CHECK_VALUES                                  \
-  " You can check all the input values with the `--printparams' "        \
+#define GAL_STRINGS_HOW_TO_CHECK_VALUES                                 \
+  " You can check all the input values with the `--printparams' "       \
   "(-P) option."
 
 #endif
diff --git a/lib/gnuastro/linkedlist.h b/lib/gnuastro/linkedlist.h
index fecca17..dc8d3b5 100644
--- a/lib/gnuastro/linkedlist.h
+++ b/lib/gnuastro/linkedlist.h
@@ -239,8 +239,8 @@ gal_linkedlist_pop_from_tsll_start(struct 
gal_linkedlist_tsll **first,
 /******************* Ordered size_t: */
 struct gal_linkedlist_osll
 {
-  size_t v;                    /* The actual value. */
-  float s;                     /* The parameter to sort by. */
+  size_t v;                       /* The actual value. */
+  float s;                        /* The parameter to sort by. */
   struct gal_linkedlist_osll *next;
 };
 
diff --git a/lib/gnuastro/mode.h b/lib/gnuastro/mode.h
index 4edcd43..19372ea 100644
--- a/lib/gnuastro/mode.h
+++ b/lib/gnuastro/mode.h
@@ -38,16 +38,16 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 struct gal_mode_params
 {
-  float     *sorted;           /* Sorted array to be used.                */
-  size_t       size;           /* Number of elements in the sorted array. */
-  size_t       lowi;           /* Lower quantile of interval.             */
-  size_t       midi;           /* Middle quantile of interval.            */
-  size_t       midd;           /* Middle index of inteval.                */
-  size_t      highi;           /* Higher quantile of interval.            */
-  float   tolerance;           /* Tolerance level to terminate search.    */
-  size_t   numcheck;           /* Number of pixels after mode to check.   */
-  size_t   interval;           /* Interval to check pixels.               */
-  float   errorstdm;           /* Multiple of standard deviation.         */
+  float     *sorted;   /* Sorted array to be used.                */
+  size_t       size;   /* Number of elements in the sorted array. */
+  size_t       lowi;   /* Lower quantile of interval.             */
+  size_t       midi;   /* Middle quantile of interval.            */
+  size_t       midd;   /* Middle index of inteval.                */
+  size_t      highi;   /* Higher quantile of interval.            */
+  float   tolerance;   /* Tolerance level to terminate search.    */
+  size_t   numcheck;   /* Number of pixels after mode to check.   */
+  size_t   interval;   /* Interval to check pixels.               */
+  float   errorstdm;   /* Multiple of standard deviation.         */
 };
 
 void
diff --git a/lib/gnuastro/neighbors.h b/lib/gnuastro/neighbors.h
index e967297..b4dd732 100644
--- a/lib/gnuastro/neighbors.h
+++ b/lib/gnuastro/neighbors.h
@@ -39,90 +39,90 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
    *ngb       : Array keeping the neighbours indexs (allocated outside).
 */
 
-#define GAL_NEIGHBORS_FILL_4_REGION {                              \
-    numngb=0;                                                     \
-    if (*ind/is1!=x0  ) ngb[numngb++]=*ind-is1;                           \
-    if (*ind/is1!=x1-1) ngb[numngb++]=*ind+is1;                           \
-    if (*ind%is1!=y0  ) ngb[numngb++]=*ind-1;                     \
-    if (*ind%is1!=y1-1) ngb[numngb++]=*ind+1;                     \
+#define GAL_NEIGHBORS_FILL_4_REGION {                                   \
+    numngb=0;                                                           \
+    if (*ind/is1!=x0  ) ngb[numngb++]=*ind-is1;                         \
+    if (*ind/is1!=x1-1) ngb[numngb++]=*ind+is1;                         \
+    if (*ind%is1!=y0  ) ngb[numngb++]=*ind-1;                           \
+    if (*ind%is1!=y1-1) ngb[numngb++]=*ind+1;                           \
   }
 
 
-#define GAL_NEIGHBORS_FILL_4_ALLIMG {                              \
-    numngb=0;                                                     \
-    if (*ind/is1!=0    ) ngb[numngb++]=*ind-is1;                  \
-    if (*ind/is1!=is0-1) ngb[numngb++]=*ind+is1;                  \
-    if (*ind%is1!=0    ) ngb[numngb++]=*ind-1;                    \
-    if (*ind%is1!=is1-1) ngb[numngb++]=*ind+1;                    \
+#define GAL_NEIGHBORS_FILL_4_ALLIMG {                                   \
+    numngb=0;                                                           \
+    if (*ind/is1!=0    ) ngb[numngb++]=*ind-is1;                        \
+    if (*ind/is1!=is0-1) ngb[numngb++]=*ind+is1;                        \
+    if (*ind%is1!=0    ) ngb[numngb++]=*ind-1;                          \
+    if (*ind%is1!=is1-1) ngb[numngb++]=*ind+1;                          \
   }
 
 
-#define GAL_NEIGHBORS_FILL_8_REGION {                              \
-    unsigned char bl=0, br=0, tl=0, tr=0;                         \
-    numngb=0;                                                     \
-    if (*ind/is1!=x0  ) {ngb[numngb++]=*ind-is1; ++bl; ++br;}     \
-    if (*ind/is1!=x1-1) {ngb[numngb++]=*ind+is1; ++tl; ++tr;}     \
-    if (*ind%is1!=y0  ) {ngb[numngb++]=*ind-1;   ++bl; ++tl;}     \
-    if (*ind%is1!=y1-1) {ngb[numngb++]=*ind+1;   ++tr; ++br;}     \
-    if (numngb==4)                                                \
-      {                                                                   \
-       numngb=8;                                                  \
-       ngb[4]=*ind-is1-1; ngb[5]=*ind-is1+1;                      \
-       ngb[6]=*ind+is1-1; ngb[7]=*ind+is1+1;                      \
-      }                                                                   \
-    else                                                          \
-      {                                                                   \
-       if(bl==2) ngb[numngb++]=*ind-is1-1;                        \
-       if(br==2) ngb[numngb++]=*ind-is1+1;                        \
-       if(tl==2) ngb[numngb++]=*ind+is1-1;                        \
-       if(tr==2) ngb[numngb++]=*ind+is1+1;                        \
-      }                                                                   \
+#define GAL_NEIGHBORS_FILL_8_REGION {                                   \
+    unsigned char bl=0, br=0, tl=0, tr=0;                               \
+    numngb=0;                                                           \
+    if (*ind/is1!=x0  ) {ngb[numngb++]=*ind-is1; ++bl; ++br;}           \
+    if (*ind/is1!=x1-1) {ngb[numngb++]=*ind+is1; ++tl; ++tr;}           \
+    if (*ind%is1!=y0  ) {ngb[numngb++]=*ind-1;   ++bl; ++tl;}           \
+    if (*ind%is1!=y1-1) {ngb[numngb++]=*ind+1;   ++tr; ++br;}           \
+    if (numngb==4)                                                      \
+      {                                                                 \
+        numngb=8;                                                       \
+        ngb[4]=*ind-is1-1; ngb[5]=*ind-is1+1;                           \
+        ngb[6]=*ind+is1-1; ngb[7]=*ind+is1+1;                           \
+      }                                                                 \
+    else                                                                \
+      {                                                                 \
+        if(bl==2) ngb[numngb++]=*ind-is1-1;                             \
+        if(br==2) ngb[numngb++]=*ind-is1+1;                             \
+        if(tl==2) ngb[numngb++]=*ind+is1-1;                             \
+        if(tr==2) ngb[numngb++]=*ind+is1+1;                             \
+      }                                                                 \
   }
 
 
-#define GAL_NEIGHBORS_FILL_8_ALLIMG {                              \
-    unsigned char bl=0, br=0, tl=0, tr=0;                         \
-    numngb=0;                                                     \
-    if (*ind/is1!=0     ) {ngb[numngb++]=*ind-is1; ++bl; ++br;}           \
-    if (*ind/is1!=is0-1 ) {ngb[numngb++]=*ind+is1; ++tl; ++tr;}           \
-    if (*ind%is1!=0     ) {ngb[numngb++]=*ind-1;   ++bl; ++tl;}           \
-    if (*ind%is1!=is1-1 ) {ngb[numngb++]=*ind+1;   ++tr; ++br;}           \
-    if (numngb==4)                                                \
-      {                                                                   \
-       numngb=8;                                                  \
-       ngb[4]=*ind-is1-1; ngb[5]=*ind-is1+1;                      \
-       ngb[6]=*ind+is1-1; ngb[7]=*ind+is1+1;                      \
-      }                                                                   \
-    else                                                          \
-      {                                                                   \
-       if(bl==2) ngb[numngb++]=*ind-is1-1;                        \
-       if(br==2) ngb[numngb++]=*ind-is1+1;                        \
-       if(tl==2) ngb[numngb++]=*ind+is1-1;                        \
-       if(tr==2) ngb[numngb++]=*ind+is1+1;                        \
-      }                                                                   \
+#define GAL_NEIGHBORS_FILL_8_ALLIMG {                                   \
+    unsigned char bl=0, br=0, tl=0, tr=0;                               \
+    numngb=0;                                                           \
+    if (*ind/is1!=0     ) {ngb[numngb++]=*ind-is1; ++bl; ++br;}         \
+    if (*ind/is1!=is0-1 ) {ngb[numngb++]=*ind+is1; ++tl; ++tr;}         \
+    if (*ind%is1!=0     ) {ngb[numngb++]=*ind-1;   ++bl; ++tl;}         \
+    if (*ind%is1!=is1-1 ) {ngb[numngb++]=*ind+1;   ++tr; ++br;}         \
+    if (numngb==4)                                                      \
+      {                                                                 \
+        numngb=8;                                                       \
+        ngb[4]=*ind-is1-1; ngb[5]=*ind-is1+1;                           \
+        ngb[6]=*ind+is1-1; ngb[7]=*ind+is1+1;                           \
+      }                                                                 \
+    else                                                                \
+      {                                                                 \
+        if(bl==2) ngb[numngb++]=*ind-is1-1;                             \
+        if(br==2) ngb[numngb++]=*ind-is1+1;                             \
+        if(tl==2) ngb[numngb++]=*ind+is1-1;                             \
+        if(tr==2) ngb[numngb++]=*ind+is1+1;                             \
+      }                                                                 \
   }
 
 
-#define GAL_NEIGHBORS_FILL_8_ALLIMG_IJ {                           \
-    unsigned char bl=0, br=0, tl=0, tr=0;                         \
-    numngb=0;                                                     \
-    if (i!=0     ) {ngb[numngb++]=(i-1)*is1+j; ++bl; ++br;}       \
-    if (i!=is0-1 ) {ngb[numngb++]=(i+1)*is1+j; ++tl; ++tr;}       \
-    if (j!=0     ) {ngb[numngb++]=i*is1+j-1;   ++bl; ++tl;}       \
-    if (j!=is1-1 ) {ngb[numngb++]=i*is1+j+1;   ++tr; ++br;}       \
-    if (numngb==4)                                                \
-      {                                                                   \
-       numngb=8;                                                  \
-       ngb[4]=(i-1)*is1+j-1; ngb[5]=(i-1)*is1+j+1;                \
-       ngb[6]=(i+1)*is1+j-1; ngb[7]=(i+1)*is1+j+1;                \
-      }                                                                   \
-    else                                                          \
-      {                                                                   \
-       if(bl==2) ngb[numngb++]=(i-1)*is1+j-1;                     \
-       if(br==2) ngb[numngb++]=(i-1)*is1+j+1;                     \
-       if(tl==2) ngb[numngb++]=(i+1)*is1+j-1;                     \
-       if(tr==2) ngb[numngb++]=(i+1)*is1+j+1;                     \
-      }                                                                   \
+#define GAL_NEIGHBORS_FILL_8_ALLIMG_IJ {                                \
+    unsigned char bl=0, br=0, tl=0, tr=0;                               \
+    numngb=0;                                                           \
+    if (i!=0     ) {ngb[numngb++]=(i-1)*is1+j; ++bl; ++br;}             \
+    if (i!=is0-1 ) {ngb[numngb++]=(i+1)*is1+j; ++tl; ++tr;}             \
+    if (j!=0     ) {ngb[numngb++]=i*is1+j-1;   ++bl; ++tl;}             \
+    if (j!=is1-1 ) {ngb[numngb++]=i*is1+j+1;   ++tr; ++br;}             \
+    if (numngb==4)                                                      \
+      {                                                                 \
+        numngb=8;                                                       \
+        ngb[4]=(i-1)*is1+j-1; ngb[5]=(i-1)*is1+j+1;                     \
+        ngb[6]=(i+1)*is1+j-1; ngb[7]=(i+1)*is1+j+1;                     \
+      }                                                                 \
+    else                                                                \
+      {                                                                 \
+        if(bl==2) ngb[numngb++]=(i-1)*is1+j-1;                          \
+        if(br==2) ngb[numngb++]=(i-1)*is1+j+1;                          \
+        if(tl==2) ngb[numngb++]=(i+1)*is1+j-1;                          \
+        if(tr==2) ngb[numngb++]=(i+1)*is1+j+1;                          \
+      }                                                                 \
   }
 
 #endif
diff --git a/lib/linkedlist.c b/lib/linkedlist.c
index be93b10..df2ad35 100644
--- a/lib/linkedlist.c
+++ b/lib/linkedlist.c
@@ -172,7 +172,7 @@ gal_linkedlist_print_fll_array(struct gal_linkedlist_fll 
**afll, size_t num)
     {
       printf(" %lu:\n", i);
       for(tmp=afll[i];tmp!=NULL;tmp=tmp->next)
-       printf("%f, ", tmp->v);
+        printf("%f, ", tmp->v);
       printf("\n");
     }
 }
@@ -534,7 +534,7 @@ gal_linkedlist_add_to_tsll_end(struct gal_linkedlist_tsll 
**last, size_t value)
   newnode->v=value;
   newnode->next=*last;
   newnode->prev=NULL;
-  if(*last)                    /* If *list is not NULL */
+  if(*last)                        /* If *list is not NULL */
     (*last)->prev=newnode;
   *last=newnode;
 }
@@ -602,21 +602,21 @@ gal_linkedlist_add_to_osll(struct gal_linkedlist_osll 
**list,
     {
       if(tosort<tmp->s) break;
       /* No need for else, it will only come here if the condition
-        above is not satisfied. */
+         above is not satisfied. */
       prev=tmp;
       tmp=tmp->next;
     }
 
-  if(tmp==NULL)             /* This is the largest value so far. */
-    {               /* '*list' only changes if it is NULL. */
+  if(tmp==NULL)      /* This is the largest value so far. */
+    {                /* '*list' only changes if it is NULL. */
       newnode->next=NULL;
       if(prev) prev->next=newnode;   /* 'prev' is not NULL! */
-      else     *list=newnode;       /* Only for initial node. */
+      else     *list=newnode;        /* Only for initial node. */
     }
   else
     {
       if(prev) prev->next=newnode;
-      else     *list=newnode;  /* 'tosort' is smaller than all. */
+      else     *list=newnode;        /* 'tosort' is smaller than all. */
       newnode->next=tmp;
     }
 }
@@ -687,7 +687,7 @@ gal_linkedlist_osll_into_sll(struct gal_linkedlist_osll *in,
             |
    NULL <-- (v0,s0) <--> (v1,s1) <--> ... (vn,sn) --> NULL
                                           |
-                          smallest pointer
+                           smallest pointer
 
    Where s(n)>s(n+1) for all n.
 */
@@ -700,7 +700,7 @@ gal_linkedlist_print_tosll(struct gal_linkedlist_tosll *l,
   while(l!=NULL)
     {
       printf("\t%-5lu (%lu, %.4f) \n", counter++,
-            l->v, l->s);
+             l->v, l->s);
       l=l->next;
       printf("\t\t\t\t(%lu, %.4f)\n", s->v, s->s);
       s=s->prev;
@@ -734,32 +734,32 @@ gal_linkedlist_add_to_tosll_end(struct 
gal_linkedlist_tosll **largest,
     {
       if(tosort >= tmp->s) break;
       /* No need for else, it will only come here if the condition
-        above is not satisfied. */
+         above is not satisfied. */
       newnode->prev=tmp;
       tmp=tmp->next;
     }
 
-  if(tmp==NULL)             /* This is the smallest value so far.     */
-    {               /* '*largest' only changes if it is NULL. */
+  if(tmp==NULL)      /* This is the smallest value so far.     */
+    {                /* '*largest' only changes if it is NULL. */
       newnode->next=NULL;
       *smallest=newnode;
-      if(newnode->prev)                /* 'prev' is not NULL! */
-       newnode->prev->next=newnode;
-      else                     /* 'prev is NULL, Only first. */
-       *largest=newnode;
+      if(newnode->prev)         /* 'prev' is not NULL! */
+        newnode->prev->next=newnode;
+      else                      /* 'prev is NULL, Only first. */
+        *largest=newnode;
     }
   else
     {
       if(newnode->prev)
-       {
-         newnode->prev->next->prev=newnode;
-         newnode->prev->next=newnode;
-       }
+        {
+          newnode->prev->next->prev=newnode;
+          newnode->prev->next=newnode;
+        }
       else
-       {
-         (*largest)->prev=newnode;
-         *largest=newnode;       /* 'tosort' is larger than all. */
-       }
+        {
+          (*largest)->prev=newnode;
+          *largest=newnode;       /* 'tosort' is larger than all. */
+        }
       newnode->next=tmp;
     }
 }
@@ -802,10 +802,10 @@ gal_linkedlist_smallest_tosll(struct gal_linkedlist_tosll 
*largest,
   while(tmp!=NULL)
     {
       if(tmp->next==NULL)
-       {
-         *smallest=tmp;
-         break;
-       }
+        {
+          *smallest=tmp;
+          break;
+        }
       tmp=tmp->next;
     }
 
diff --git a/lib/mesh.c b/lib/mesh.c
index 930d64c..59ff44d 100644
--- a/lib/mesh.c
+++ b/lib/mesh.c
@@ -392,7 +392,8 @@ gal_check_mesh_id(struct gal_mesh_params *mp, long **out)
   errno=0;
   *out=calloc(mp->s0*mp->s1, sizeof **out);
   if(*out==NULL)
-    error(EXIT_FAILURE, errno, "the array to show mesh labels in checkmesh");
+    error(EXIT_FAILURE, errno,
+          "the array to show mesh labels in checkmesh");
 
   /* Fill the indexs: */
   for(i=0;i<mp->nmeshi;++i)
@@ -418,7 +419,8 @@ gal_check_mesh_id(struct gal_mesh_params *mp, long **out)
    input image. Note that the check arrays are only the size of the
    number of meshs, not the actual input image size. */
 void
-gal_mesh_check_garray(struct gal_mesh_params *mp, float **out1, float **out2)
+gal_mesh_check_garray(struct gal_mesh_params *mp, float **out1,
+                      float **out2)
 {
   int ngarrays=mp->ngarrays;
   size_t gid, row, start, chbasedid, *types=mp->types;
@@ -430,8 +432,9 @@ gal_mesh_check_garray(struct gal_mesh_params *mp, float 
**out1, float **out2)
      there is no overlap. */
   errno=0; *out1=malloc(mp->s0*mp->s1*sizeof **out1);
   if(*out1==NULL)
-    error(EXIT_FAILURE, errno, "%lu bytes for out1 in gal_mesh_check_garray "
-          "(mesh.c)", mp->s0*mp->s1*sizeof **out1);
+    error(EXIT_FAILURE, errno,
+          "%lu bytes for out1 in gal_mesh_check_garray (mesh.c)",
+          mp->s0*mp->s1*sizeof **out1);
   if(ngarrays==2)
     {
       errno=0; *out2=malloc(mp->s0*mp->s1*sizeof **out2);
@@ -481,8 +484,9 @@ gal_mesh_check_garray(struct gal_mesh_params *mp, float 
**out1, float **out2)
 
 /* Save the mesh grid values into an output file. */
 void
-gal_mesh_value_file(struct gal_mesh_params *mp, char *filename, char *extname1,
-                    char *extname2, struct wcsprm *wcs, char *spack_string)
+gal_mesh_value_file(struct gal_mesh_params *mp, char *filename,
+                    char *extname1, char *extname2, struct wcsprm *wcs,
+                    char *spack_string)
 {
   float *tmp1=NULL, *tmp2=NULL;
 
@@ -499,8 +503,8 @@ gal_mesh_value_file(struct gal_mesh_params *mp, char 
*filename, char *extname1,
                              mp->gs1*mp->nch1, 0, wcs, NULL,
                              spack_string);
       if(mp->ngarrays==2)
-        /* Note that gal_mesh_full_garray will correct both the meshs if there
-           are two.*/
+        /* Note that gal_mesh_full_garray will correct both the meshs if
+           there are two.*/
         gal_fits_array_to_file(filename, extname2, FLOAT_IMG,
                                mp->fgarray2, mp->gs0*mp->nch2,
                                mp->gs1*mp->nch1, 0, wcs, NULL,
@@ -600,7 +604,7 @@ fillmeshinfo(struct gal_mesh_params *mp, size_t chs0, 
size_t chs1,
       if(ts1[typeind]>mp->maxs1) mp->maxs1=ts1[typeind];
 
       for(chi=0;chi<nch2;++chi)   /* Don't forget that C and FITS */
-       for(chj=0;chj<nch1;++chj) /* axises have different order. */
+        for(chj=0;chj<nch1;++chj) /* axises have different order. */
           {
             chid=chi*nch1+chj;
             for(i=0;i<lasti;++i)
@@ -630,7 +634,7 @@ fillmeshinfo(struct gal_mesh_params *mp, size_t chs0, 
size_t chs1,
       if(ts1[typeind]>mp->maxs1) mp->maxs1=ts1[typeind];
 
       for(chi=0;chi<nch2;++chi)
-       for(chj=0;chj<nch1;++chj)
+        for(chj=0;chj<nch1;++chj)
           {
             chid=chi*nch1+chj;
             for(j=0;j<lastj;++j)
@@ -659,7 +663,7 @@ fillmeshinfo(struct gal_mesh_params *mp, size_t chs0, 
size_t chs1,
       if(ts1[typeind]>mp->maxs1) mp->maxs1=ts1[typeind];
 
       for(chi=0;chi<nch2;++chi)
-       for(chj=0;chj<nch1;++chj)
+        for(chj=0;chj<nch1;++chj)
           {
             chid=chi*nch1+chj;
             for(i=0;i<lasti;++i)
@@ -688,24 +692,24 @@ fillmeshinfo(struct gal_mesh_params *mp, size_t chs0, 
size_t chs1,
       if(ts1[typeind]>mp->maxs1) mp->maxs1=ts1[typeind];
 
       for(chi=0;chi<nch2;++chi)
-       for(chj=0;chj<nch1;++chj)
-         {
+        for(chj=0;chj<nch1;++chj)
+          {
             ++totalmeshcount;
-           meshid=(chi*nch1+chj)*nmeshc + gs0*gs1-1;
-           types[meshid]=typeind;
+            meshid=(chi*nch1+chj)*nmeshc + gs0*gs1-1;
+            types[meshid]=typeind;
             chindex[meshid]=gs0*gs1-1;
-           imgindex[meshid]=( (chi*gs0+(gs0-1)) * nch1*gs1
+            imgindex[meshid]=( (chi*gs0+(gs0-1)) * nch1*gs1
                                + (chj*gs1+(gs1-1)) );
-           start[meshid]=( (chi*chs0+(gs0-1)*meshsize) * s1
-                                + (chj*chs1+(gs1-1)*meshsize) );
-         }
+            start[meshid]=( (chi*chs0+(gs0-1)*meshsize) * s1
+                                 + (chj*chs1+(gs1-1)*meshsize) );
+          }
     }
 
   /* Just for a check: */
   if(totalmeshcount!=mp->nmeshi)
-    error(EXIT_FAILURE, 0, "a bug! Please contact us at %s so we can fix it. "
-          "The basic information for some meshes has not been found (in "
-          "fillmeshinfo of mesh.c)", PACKAGE_BUGREPORT);
+    error(EXIT_FAILURE, 0, "a bug! Please contact us at %s so we can fix "
+          "it. The basic information for some meshes has not been found "
+          "(in fillmeshinfo of mesh.c)", PACKAGE_BUGREPORT);
 }
 
 
@@ -872,8 +876,9 @@ gal_mesh_free_mesh(struct gal_mesh_params *mp)
       allocated in case your operation needs one.
 */
 void
-gal_mesh_operate_on_mesh(struct gal_mesh_params *mp, void *(*meshfunc)(void *),
-                         size_t oneforallsize, int makegarray2, int initialize)
+gal_mesh_operate_on_mesh(struct gal_mesh_params *mp,
+                         void *(*meshfunc)(void *), size_t oneforallsize,
+                         int makegarray2, int initialize)
 {
   int err;
   size_t i, nb;
@@ -949,22 +954,22 @@ gal_mesh_operate_on_mesh(struct gal_mesh_params *mp, void 
*(*meshfunc)(void *),
   else
     {
       /* Initialize the attributes. Note that this running thread
-        (that spinns off the nt threads) is also a thread, so the
-        number the barrier should be one more than the number of
-        threads spinned off. */
+         (that spinns off the nt threads) is also a thread, so the
+         number the barrier should be one more than the number of
+         threads spinned off. */
       if(mp->nmeshi<numthreads) nb=mp->nmeshi+1;
       else                      nb=numthreads+1;
       gal_threads_attr_barrier_init(&attr, &mp->b, nb);
 
       /* Spin off the threads: */
       for(i=0;i<numthreads;++i)
-       if(mp->indexs[i*mp->thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
-         {
+        if(mp->indexs[i*mp->thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
+          {
             mtp[i].id=i;
-           mtp[i].mp=mp;
-           err=pthread_create(&t, &attr, meshfunc, &mtp[i]);
-           if(err) error(EXIT_FAILURE, 0, "can't create thread %lu", i);
-         }
+            mtp[i].mp=mp;
+            err=pthread_create(&t, &attr, meshfunc, &mtp[i]);
+            if(err) error(EXIT_FAILURE, 0, "can't create thread %lu", i);
+          }
 
       /* Wait for all threads to finish and free the spaces. */
       pthread_barrier_wait(&mp->b);
@@ -1095,8 +1100,8 @@ manhattandistance(long ind, long xc, long yc, long s1)
 
 
 /* Some of the variables have different names than the gal_mesh_params
-   structure because they are to be fed into the GAL_NEIGHBORS_FILL_4_ALLIMG
-   macro. */
+   structure because they are to be fed into the
+   GAL_NEIGHBORS_FILL_4_ALLIMG macro. */
 void *
 meshinterponthread(void *inparams)
 {
@@ -1210,11 +1215,12 @@ meshinterponthread(void *inparams)
                   mp->errstart, currentnum, thisind/mp->nmeshc, mtp->id,
                   thisind);
         }
-      gal_linkedlist_tosll_free(lQ);  /* The rest of the queue not needed. */
+      gal_linkedlist_tosll_free(lQ);  /* Rest of the queue not needed. */
 
 
       /* Find the median of the nearest neighbors and put it in: */
-      qsort(nearest1, numnearest, sizeof *nearest1, 
gal_qsort_float_increasing);
+      qsort(nearest1, numnearest, sizeof *nearest1,
+            gal_qsort_float_increasing);
       outgarray1[thisind] = ( numnearest%2 ?
                               nearest1[numnearest/2] : /* Odd.  */
                               (nearest1[numnearest/2]  /* Even. */
@@ -1272,22 +1278,22 @@ gal_mesh_interpolate(struct gal_mesh_params *mp, char 
*errstart)
   else
     {
       /* Initialize the attributes. Note that this running thread
-        (that spinns off the nt threads) is also a thread, so the
-        number the barrier should be one more than the number of
-        threads spinned off. */
+         (that spinns off the nt threads) is also a thread, so the
+         number the barrier should be one more than the number of
+         threads spinned off. */
       if(mp->nmeshi<numthreads) nb=mp->nmeshi+1;
       else                      nb=numthreads+1;
       gal_threads_attr_barrier_init(&attr, &mp->b, nb);
 
       /* Spin off the threads: */
       for(i=0;i<numthreads;++i)
-       if(mp->indexs[i*mp->thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
-         {
+        if(mp->indexs[i*mp->thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
+          {
             mtp[i].id=i;
-           mtp[i].mp=mp;
-           err=pthread_create(&t, &attr, meshinterponthread, &mtp[i]);
-           if(err) error(EXIT_FAILURE, 0, "can't create thread %lu", i);
-         }
+            mtp[i].mp=mp;
+            err=pthread_create(&t, &attr, meshinterponthread, &mtp[i]);
+            if(err) error(EXIT_FAILURE, 0, "can't create thread %lu", i);
+          }
 
       /* Wait for all threads to finish and free the spaces. */
       pthread_barrier_wait(&mp->b);
@@ -1380,16 +1386,17 @@ gal_mesh_smooth(struct gal_mesh_params *mp)
 
       /* Do the spatial convolution */
       gal_spatialconvolve_convolve(mp->fgarray1, gs0*mp->nch2, gs1*mp->nch1,
-                                   kernel, smoothwidth, smoothwidth, 
numthreads,
-                                   1, &sgarray1);
+                                   kernel, smoothwidth, smoothwidth,
+                                   numthreads, 1, &sgarray1);
 
       free(mp->fgarray1);
       mp->garray1=mp->fgarray1=sgarray1;
       if(mp->ngarrays==2)
         {
-          gal_spatialconvolve_convolve(mp->fgarray2, gs0*mp->nch2, 
gs1*mp->nch1,
-                                       kernel, smoothwidth, smoothwidth,
-                                       mp->numthreads, 1, &sgarray2);
+          gal_spatialconvolve_convolve(mp->fgarray2, gs0*mp->nch2,
+                                       gs1*mp->nch1, kernel, smoothwidth,
+                                       smoothwidth, mp->numthreads,
+                                       1, &sgarray2);
           free(mp->fgarray2);
           mp->garray2=mp->fgarray2=sgarray2;
         }
@@ -1415,8 +1422,9 @@ gal_mesh_smooth(struct gal_mesh_params *mp)
         if(mp->ngarrays==2)
           {
             charray=&mp->cgarray2[chid*nmeshc];
-            gal_spatialconvolve_convolve(charray, gs0, gs1, kernel, 
smoothwidth,
-                                         smoothwidth, numthreads, 1, &tmp);
+            gal_spatialconvolve_convolve(charray, gs0, gs1, kernel,
+                                         smoothwidth, smoothwidth,
+                                         numthreads, 1, &tmp);
             o=tmp; fp=(f=charray)+gs0*gs1; do *f=*o++; while(++f<fp);
             free(tmp);
           }
@@ -1483,7 +1491,7 @@ meshspatialconvonthreads(void *inparam)
       /* If the mesh is on the edge of the channel it should be
          treated differently compared to when it is not. */
       if( x>=xmin && ystart>=ymin && fx<xmax && fy<ymax )
-       {                       /* All pixels in this mesh are distant  */
+        {                       /* All pixels in this mesh are distant  */
           for(;x<fx;++x)        /* enough from the edge of the channel. */
             for(y=ystart;y<fy;++y)
               {
@@ -1502,12 +1510,12 @@ meshspatialconvonthreads(void *inparam)
                     conv[x*is1+y] = sum/ksum;
                   }
               }
-       }
+        }
       else
-       {                       /* Some pixels in this mesh are too  */
-         for(;x<fx;++x)        /* close to the edge.                */
-           for(y=ystart;y<fy;++y)
-             {
+        {                       /* Some pixels in this mesh are too  */
+          for(;x<fx;++x)        /* close to the edge.                */
+            for(y=ystart;y<fy;++y)
+              {
                 if( isnan(img[x*is1+y]) )
                     conv[x*is1+y]=NAN;
                 else
@@ -1542,7 +1550,7 @@ meshspatialconvonthreads(void *inparam)
                     conv[x*is1+y] = sum/ksum;
                   }
             }
-       }
+        }
     }
 
   /* Free alltype and if multiple threads were used, wait until all
@@ -1625,24 +1633,24 @@ gal_mesh_spatial_convolve_on_mesh(struct 
gal_mesh_params *mp, float **conv)
   else
     {
       /* Initialize the attributes. Note that this running thread
-        (that spinns off the nt threads) is also a thread, so the
-        number the barrier should be one more than the number of
-        threads spinned off. */
+         (that spinns off the nt threads) is also a thread, so the
+         number the barrier should be one more than the number of
+         threads spinned off. */
       if(mp->nmeshi<numthreads) nb=mp->nmeshi+1;
       else                      nb=numthreads+1;
       gal_threads_attr_barrier_init(&attr, &mp->b, nb);
 
       /* Spin off the threads: */
       for(i=0;i<numthreads;++i)
-       if(mp->indexs[i*mp->thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
-         {
+        if(mp->indexs[i*mp->thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
+          {
             mtp[i].id=i;
-           mtp[i].mp=mp;
+            mtp[i].mp=mp;
             mtp[i].conv=*conv;
             mtp[i].chbrd=chbrd;
-           err=pthread_create(&t, &attr, meshspatialconvonthreads, &mtp[i]);
-           if(err) error(EXIT_FAILURE, 0, "can't create thread %lu", i);
-         }
+            err=pthread_create(&t, &attr, meshspatialconvonthreads, &mtp[i]);
+            if(err) error(EXIT_FAILURE, 0, "can't create thread %lu", i);
+          }
 
       /* Wait for all threads to finish and free the spaces. */
       pthread_barrier_wait(&mp->b);
@@ -1659,17 +1667,18 @@ gal_mesh_spatial_convolve_on_mesh(struct 
gal_mesh_params *mp, float **conv)
 
 
 
-/* The indexs array for correcting the convolution on inner channel edges has
-   been allocated.  Note that gal_threads_dist_in_threads will distribute 
indexs
-   from zero to numpix-1.  After it, we should fill in all the channels.
+/* The indexs array for correcting the convolution on inner channel edges
+   has been allocated.  Note that gal_threads_dist_in_threads will
+   distribute indexs from zero to numpix-1.  After it, we should fill in
+   all the channels.
 
    The method of filling in the indexs array with the proper indexs to
    re-convolve is very similar to the method explained below in
-   gal_mesh_change_to_full_convolution, where it is explained how to count the
-   number of pixels that should be re-convolved. */
+   gal_mesh_change_to_full_convolution, where it is explained how to count
+   the number of pixels that should be re-convolved. */
 void
-corrconvindexs(struct gal_mesh_params *mp, size_t **indexs, size_t *numpix,
-               size_t *thrdcols)
+corrconvindexs(struct gal_mesh_params *mp, size_t **indexs,
+               size_t *numpix, size_t *thrdcols)
 {
   size_t i, j, a, b;
   size_t numthreads=mp->numthreads;
@@ -1740,8 +1749,8 @@ corrconvindexs(struct gal_mesh_params *mp, size_t 
**indexs, size_t *numpix,
               ahigh = i*npch0<hk0    ? 0  : i*npch0-hk0;
 
               /* For a check:
-              printf("2: alow: %-4lu ahigh: %-4lu. b: %-10lu (%lu -- %lu)\n",
-                     alow, ahigh, b, blow, bhigh);
+              printf("2: alow: %-4lu ahigh: %-4lu. b: %-10lu "
+                     "(%lu -- %lu)\n", alow, ahigh, b, blow, bhigh);
               */
               for(a=alow;a<ahigh;++a)
                 {
@@ -1791,10 +1800,11 @@ corrconvindexs(struct gal_mesh_params *mp, size_t 
**indexs, size_t *numpix,
    (whose distance from the channel edges is more than half the PSF),
    do not need to undergo convolution again.
 
-   Note that the pixels on the edges of the image do not need to undergo this
-   correction.  Basically this function is very similar to
-   gal_spatialconvolve_convolve (spatialconvolve.c), other than the fact that
-   the indexs are not over the full image but only a select number of pixels.
+   Note that the pixels on the edges of the image do not need to undergo
+   this correction.  Basically this function is very similar to
+   gal_spatialconvolve_convolve (spatialconvolve.c), other than the fact
+   that the indexs are not over the full image but only a select number of
+   pixels.
 */
 void
 gal_mesh_change_to_full_convolution(struct gal_mesh_params *mp, float *conv)
@@ -1819,8 +1829,8 @@ gal_mesh_change_to_full_convolution(struct 
gal_mesh_params *mp, float *conv)
   scp=malloc(mp->numthreads*sizeof *scp);
   if(scp==NULL)
     error(EXIT_FAILURE, errno,
-          "%lu bytes for scp in gal_mesh_change_to_full_convolution (mesh.c)",
-          mp->numthreads*sizeof *scp);
+          "%lu bytes for scp in gal_mesh_change_to_full_convolution "
+          "(mesh.c)", mp->numthreads*sizeof *scp);
 
 
   /* Put the indexs of the pixels to re-convolve here. */
@@ -1830,17 +1840,17 @@ gal_mesh_change_to_full_convolution(struct 
gal_mesh_params *mp, float *conv)
   /* Start the convolution on the desired pixels. */
   if(mp->numthreads==1)
     {
-      gal_spatialconvolve_pparams(mp->img, mp->s0, mp->s1, mp->kernel, mp->ks0,
-                                  mp->ks1, mp->numthreads, 1, conv, indexs,
-                                  &scp[0]);
+      gal_spatialconvolve_pparams(mp->img, mp->s0, mp->s1, mp->kernel,
+                                  mp->ks0, mp->ks1, mp->numthreads, 1,
+                                  conv, indexs, &scp[0]);
       gal_spatialconvolve_thread(&scp[0]);
     }
   else
     {
       /* Initialize the attributes. Note that this running thread
-        (that spinns off the nt threads) is also a thread, so the
-        number the barrier should be one more than the number of
-        threads spinned off. */
+         (that spinns off the nt threads) is also a thread, so the
+         number the barrier should be one more than the number of
+         threads spinned off. */
       if(numpix<mp->numthreads) nb=numpix+1;
       else                      nb=mp->numthreads+1;
       gal_threads_attr_barrier_init(&attr, &b, nb);
@@ -1853,9 +1863,10 @@ gal_mesh_change_to_full_convolution(struct 
gal_mesh_params *mp, float *conv)
             gal_spatialconvolve_pparams(mp->img, mp->s0, mp->s1, mp->kernel,
                                         mp->ks0, mp->ks1, mp->numthreads, 1,
                                         conv, &indexs[i*thrdcols], &scp[i]);
-           err=pthread_create(&t, &attr, gal_spatialconvolve_thread, &scp[i]);
-           if(err)
-             error(EXIT_FAILURE, 0, "can't create thread %lu", i);
+            err=pthread_create(&t, &attr, gal_spatialconvolve_thread,
+                               &scp[i]);
+            if(err)
+              error(EXIT_FAILURE, 0, "can't create thread %lu", i);
           }
 
       /* Wait for all threads to finish and free the spaces. */
diff --git a/lib/mode.c b/lib/mode.c
index ec20608..b226737 100644
--- a/lib/mode.c
+++ b/lib/mode.c
@@ -84,8 +84,8 @@ makemirrored(float *in, size_t mi, float **outmirror, size_t 
*outsize)
   errno=0;
   mirror=malloc(size*sizeof *mirror);
   if(mirror==NULL)
-    error(EXIT_FAILURE, errno, "%lu bytes for mirror array in makemirrored "
-          "(mode.c)", size*sizeof *mirror);
+    error(EXIT_FAILURE, errno, "%lu bytes for mirror array in "
+          "makemirrored (mode.c)", size*sizeof *mirror);
 
   for(i=0;i<=mi;++i)
     mirror[i]    = in[i];
@@ -139,8 +139,8 @@ gal_mode_make_mirror_plots(float *sorted, size_t size, 
size_t mirrorindex,
   errno=0;
   out=malloc(numbins*3*sizeof *out);
   if(out==NULL)
-    error(EXIT_FAILURE, errno, "%lu bytes for out in 
gal_mode_make_mirror_plots"
-          " (mode.c)", numbins*3*sizeof *out);
+    error(EXIT_FAILURE, errno, "%lu bytes for out in "
+          "gal_mode_make_mirror_plots (mode.c)", numbins*3*sizeof *out);
 
 
   /* Define the bin sides: */
@@ -151,7 +151,8 @@ gal_mode_make_mirror_plots(float *sorted, size_t size, 
size_t mirrorindex,
   /* Find the histogram of the actual data and put it in out. Note
      that maxhistone=0, because here we want to use one value for both
      histograms so they are comparable. */
-  gal_statistics_histogram(actual, size, bins, numbins, normhist, maxhistone);
+  gal_statistics_histogram(actual, size, bins, numbins,
+                           normhist, maxhistone);
   for(i=0;i<numbins;++i)
     if(bins[i*2+1]>maxhist) maxhist=bins[i*2+1];
   for(i=0;i<numbins;++i)
@@ -162,7 +163,8 @@ gal_mode_make_mirror_plots(float *sorted, size_t size, 
size_t mirrorindex,
 
   /* Find the histogram of the mirrired distribution and put it in
      out: */
-  gal_statistics_histogram(mirror, msize, bins, numbins, normhist, maxhistone);
+  gal_statistics_histogram(mirror, msize, bins, numbins, normhist,
+                           maxhistone);
   for(i=0;i<numbins;++i)
     { out[i*3+2]=bins[i*2+1]/maxhist; bins[i*2+1]=0.0f;}
   bins[i*2+1]=0.0f; /* bins[] actually has numbins+1 elements. */
@@ -179,7 +181,7 @@ gal_mode_make_mirror_plots(float *sorted, size_t size, 
size_t mirrorindex,
   fprintf(fp, "# Column 2: Mirror distribution.\n");
   for(i=0;i<numbins;++i)
     fprintf(fp, "%-25.6f%-25.6f%-25.6f\n", out[i*3]+d,
-           out[i*3+1], out[i*3+2]);
+            out[i*3+1], out[i*3+2]);
   fclose(fp);
 
 
@@ -203,15 +205,16 @@ gal_mode_make_mirror_plots(float *sorted, size_t size, 
size_t mirrorindex,
   else maxcfp=msize;
   errno=0;
   fp=fopen(cfpsname, "w");
-  if(fp==NULL) error(EXIT_FAILURE, errno, "could not open file %s", cfpsname);
+  if(fp==NULL)
+    error(EXIT_FAILURE, errno, "could not open file %s", cfpsname);
   fprintf(fp, "# Cumulative frequency plot (average index in bin) of\n"
-         "# Actual and mirrored distributions.\n");
+          "# Actual and mirrored distributions.\n");
   fprintf(fp, "# Column 0: Value in the middle of this bin.\n");
   fprintf(fp, "# Column 1: Actual data.\n");
   fprintf(fp, "# Column 2: Mirror distribution.\n");
   for(i=0;i<numbins;++i)
     fprintf(fp, "%-25.6f%-25.6f%-25.6f\n", out[i*3],
-           out[i*3+1]/maxcfp, out[i*3+2]/maxcfp);
+            out[i*3+1]/maxcfp, out[i*3+2]/maxcfp);
   fclose(fp);
 
 
@@ -274,7 +277,7 @@ gal_mode_make_mirror_plots(float *sorted, size_t size, 
size_t mirrorindex,
   in speeding up the job :-D. Only for the first element, `prevj=0`.*/
 size_t
 mirrormaxdiff(float *a, size_t size, size_t m,
-             size_t numcheck, size_t interval, size_t stdm)
+              size_t numcheck, size_t interval, size_t stdm)
 {
   /* The variables:
    i:        Index on mirror distribution.
@@ -304,33 +307,33 @@ mirrormaxdiff(float *a, size_t size, size_t m,
          if a[m+j]. We change `j` accordingly and break out of the `j`
          loop. */
       for(j=prevj;j<size-m;++j)
-       if(a[m+j]>mf)
-         {
-           if( a[m+j]-mf < mf-a[m+j-1] )
-             break;
-           else
-             {
-               j--;
-               break;
-             }
-         }
+        if(a[m+j]>mf)
+          {
+            if( a[m+j]-mf < mf-a[m+j-1] )
+              break;
+            else
+              {
+                j--;
+                break;
+              }
+          }
       /*
       printf("i:%-5lu j:%-5lu diff:%-5d maxdiff: %lu\n",
-            i, j, (int)j-(int)i, maxdiff);
+             i, j, (int)j-(int)i, maxdiff);
       */
       /* The index of the actual CDF corresponding the the mirrored
-        flux has been found. We want the mirrored distribution to be
-        within the actual distribution, not beyond it, so the only
-        acceptable results are when i<j. If i>j+errordiff then the
-        result is not acceptable! */
+         flux has been found. We want the mirrored distribution to be
+         within the actual distribution, not beyond it, so the only
+         acceptable results are when i<j. If i>j+errordiff then the
+         result is not acceptable! */
       if(i>j+errordiff)
-       {
-         maxdiff=GAL_MODE_MIRROR_IS_ABOVE_RESULT;
-         break;
-       }
+        {
+          maxdiff=GAL_MODE_MIRROR_IS_ABOVE_RESULT;
+          break;
+        }
       absdiff  = i>j ? i-j : j-i;
       if(absdiff>maxdiff)
-       maxdiff=absdiff;
+        maxdiff=absdiff;
 
       prevj=j;
     }
@@ -342,19 +345,22 @@ mirrormaxdiff(float *a, size_t size, size_t m,
 
 
 /* Find the mode of a float array of size `size`. I assume that
-   mirrormaxdiff() has one minimum (within the statistical
-   errors) in the function. To find that minimum, the golden section
-   search algorithm is going to used. Read the Wikipedia article for a
-   very nice introduction. In summary we will constantly be finding
-   middle points in the given interval and thus decreasing the
-   interval until a certain tolerance is reached.
-
-   If the input interval is on points `a` and `b`, then the middle point (lets
-   call it `c`, where c>a and c<b) to test should be positioned such that
-   (b-c)/(c-a)=GAL_MODE_GOLDEN_RATIO. Once we open up this relation, we can 
find
-   c using: c=(b+GAL_MODE_GOLDEN_RATIO*a)/(1+GAL_MODE_GOLDEN_RATIO). We need a
-   fourth point to be placed between. With this configuration, the probing 
point
-   is located at: */
+   mirrormaxdiff() has one minimum (within the statistical errors) in the
+   function. To find that minimum, the golden section search algorithm is
+   going to used. Read the Wikipedia article for a very nice
+   introduction. In summary we will constantly be finding middle points in
+   the given interval and thus decreasing the interval until a certain
+   tolerance is reached.
+
+   If the input interval is on points `a` and `b`, then the middle point
+   (lets call it `c`, where c>a and c<b) to test should be positioned such
+   that (b-c)/(c-a)=GAL_MODE_GOLDEN_RATIO. Once we open up this relation,
+   we can find c using:
+
+      c=(b+GAL_MODE_GOLDEN_RATIO*a)/(1+GAL_MODE_GOLDEN_RATIO).
+
+   We need a fourth point to be placed between. With this configuration,
+   the probing point is located at: */
 size_t
 modegoldenselection(struct gal_mode_params *mp)
 {
@@ -381,7 +387,7 @@ modegoldenselection(struct gal_mode_params *mp)
 
   /* Find the maximum difference for this quantile. */
   dd = mirrormaxdiff(mp->sorted, mp->size, di, mp->numcheck,
-                    mp->interval, mp->errorstdm);
+                     mp->interval, mp->errorstdm);
 
   /*------------------------------------------------------------------
   sprintf(outname, "%dcmp.pdf", counter);
@@ -394,28 +400,28 @@ modegoldenselection(struct gal_mode_params *mp)
   /*
   printf("%-5lu\t%-5lu(%d)\t%-5lu ----> dq: %-5lu di: %d\n",
          mp->lowi, mp->midi, (int)mp->midd, mp->highi,
-        di, (int)dd);
+         di, (int)dd);
   */
-  /* +++++++++++++ The mirrored distribution's cumulative frequency
-     plot has be lower than the actual's cfp. If it isn't, `di` will
-     be GAL_MODE_MIRROR_IS_ABOVE_RESULT. In this case, the normal golden 
section
-     minimization is not going to give us what we want. So I have added this
-     modification to it. In such cases, we want the search to go to the lower
-     intervals.*/
+  /* +++++++++++++ The mirrored distribution's cumulative frequency plot
+     has be lower than the actual's cfp. If it isn't, `di` will be
+     GAL_MODE_MIRROR_IS_ABOVE_RESULT. In this case, the normal golden
+     section minimization is not going to give us what we want. So I have
+     added this modification to it. In such cases, we want the search to go
+     to the lower intervals.*/
   if(dd==GAL_MODE_MIRROR_IS_ABOVE_RESULT)
     {
       if(mp->midi < di)
-       {
-         mp->highi=di;
-         return modegoldenselection(mp);
-       }
+        {
+          mp->highi=di;
+          return modegoldenselection(mp);
+        }
       else
-       {
-         mp->highi=mp->midi;
-         mp->midi=di;
-         mp->midd=dd;
-         return modegoldenselection(mp);
-       }
+        {
+          mp->highi=mp->midi;
+          mp->midi=di;
+          mp->midd=dd;
+          return modegoldenselection(mp);
+        }
     }
   /* +++++++++++++ End of my addition to the golden section search. */
 
@@ -423,32 +429,32 @@ modegoldenselection(struct gal_mode_params *mp)
   if(dd<mp->midd)
     {
       if(mp->highi-mp->midi > mp->midi-mp->lowi)
-       {
-         mp->lowi  = mp->midi;
-         mp->midi  = di;
-         mp->midd  = dd;
-         return modegoldenselection(mp);
-       }
+        {
+          mp->lowi  = mp->midi;
+          mp->midi  = di;
+          mp->midd  = dd;
+          return modegoldenselection(mp);
+        }
       else
-       {
-         mp->highi = mp->midi;
-         mp->midi  = di;
-         mp->midd  = dd;
-         return modegoldenselection(mp);
-       }
+        {
+          mp->highi = mp->midi;
+          mp->midi  = di;
+          mp->midd  = dd;
+          return modegoldenselection(mp);
+        }
     }
   else
     {
       if(mp->highi-mp->midi > mp->midi-mp->lowi)
-       {
-         mp->highi = di;
-         return modegoldenselection(mp);
-       }
+        {
+          mp->highi = di;
+          return modegoldenselection(mp);
+        }
       else
-       {
-         mp->lowi  = di;
-         return modegoldenselection(mp);
-       }
+        {
+          mp->lowi  = di;
+          return modegoldenselection(mp);
+        }
     }
 }
 
@@ -469,7 +475,7 @@ modegoldenselection(struct gal_mode_params *mp)
    for `b` only goes to the 95% of the distribution.  */
 void
 modesymmetricity(float *a, size_t size, size_t mi, float errorstdm,
-                float *sym)
+                 float *sym)
 {
   float af, bf, mf, fi;
   size_t i, j, bi=0, topi, errdiff, prevj=0;
@@ -488,22 +494,22 @@ modesymmetricity(float *a, size_t size, size_t mi, float 
errorstdm,
       fi=2*mf-a[mi-i];
 
       for(j=prevj;j<size-mi;++j)
-       if(a[mi+j]>fi)
-         {
-           if( a[mi+j]-fi < fi-a[mi+j-1] )
-             break;
-           else
-             {
-               j--;
-               break;
-             }
-         }
+        if(a[mi+j]>fi)
+          {
+            if( a[mi+j]-fi < fi-a[mi+j-1] )
+              break;
+            else
+              {
+                j--;
+                break;
+              }
+          }
 
       if(i>j+errdiff || j>i+errdiff)
-       {
-         bi=mi+i;
-         break;
-       }
+        {
+          bi=mi+i;
+          break;
+        }
       prevj=j;
     }
 
@@ -533,7 +539,8 @@ modesymmetricity(float *a, size_t size, size_t mi, float 
errorstdm,
    it just finds bf from the equation to calculate symmetricity in
    modesymmetricity. */
 float
-gal_mode_value_from_sym(float *sorted, size_t size, size_t modeindex, float 
sym)
+gal_mode_value_from_sym(float *sorted, size_t size, size_t modeindex,
+                        float sym)
 {
   float mf=sorted[modeindex];
   float af=
@@ -571,12 +578,14 @@ gal_mode_index_in_sorted(float *sorted, size_t size, 
float errorstdm,
   if(mp.numcheck>1000)
     mp.interval=mp.numcheck/1000;
   else mp.interval=1;
-  mp.lowi  = gal_statistics_index_from_quantile(size, GAL_MODE_LOW_QUANTILE);
-  mp.highi = gal_statistics_index_from_quantile(size, GAL_MODE_HIGH_QUANTILE);
+  mp.lowi  = gal_statistics_index_from_quantile(size,
+                                                GAL_MODE_LOW_QUANTILE);
+  mp.highi = gal_statistics_index_from_quantile(size,
+                                                GAL_MODE_HIGH_QUANTILE);
   mp.midi  = ((float)mp.highi
-              +GAL_MODE_GOLDEN_RATIO*(float)mp.lowi)/(1+GAL_MODE_GOLDEN_RATIO);
+              + 
GAL_MODE_GOLDEN_RATIO*(float)mp.lowi)/(1+GAL_MODE_GOLDEN_RATIO);
   mp.midd  = mirrormaxdiff(mp.sorted, mp.size, mp.midi, mp.numcheck,
-                          mp.interval, mp.errorstdm);
+                           mp.interval, mp.errorstdm);
 
   /* Do the golden section search and find the resulting
      symmetricity. */
diff --git a/lib/spatialconvolve.c b/lib/spatialconvolve.c
index 7b72872..13bdf8d 100644
--- a/lib/spatialconvolve.c
+++ b/lib/spatialconvolve.c
@@ -201,9 +201,9 @@ gal_spatialconvolve_convolve(float *input, size_t is0, 
size_t is1,
   else
     {
       /* Initialize the attributes. Note that this running thread
-        (that spinns off the nt threads) is also a thread, so the
-        number the barrier should be one more than the number of
-        threads spinned off. */
+         (that spinns off the nt threads) is also a thread, so the
+         number the barrier should be one more than the number of
+         threads spinned off. */
       if(is0*is1<nt) nb=is0*is1+1;
       else nb=nt+1;
       gal_threads_attr_barrier_init(&attr, &b, nb);
@@ -213,12 +213,13 @@ gal_spatialconvolve_convolve(float *input, size_t is0, 
size_t is1,
         if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
           {
             scp[i].b=&b;
-            gal_spatialconvolve_pparams(input, is0, is1, kernel, ks0, ks1, nt,
-                                        edgecorrection, *out,
+            gal_spatialconvolve_pparams(input, is0, is1, kernel, ks0,
+                                        ks1, nt, edgecorrection, *out,
                                         &indexs[i*thrdcols], &scp[i]);
-           err=pthread_create(&t, &attr, gal_spatialconvolve_thread, &scp[i]);
-           if(err)
-             error(EXIT_FAILURE, 0, "can't create thread %lu", i);
+            err=pthread_create(&t, &attr, gal_spatialconvolve_thread,
+                               &scp[i]);
+            if(err)
+              error(EXIT_FAILURE, 0, "can't create thread %lu", i);
           }
 
       /* Wait for all threads to finish and free the spaces. */
diff --git a/lib/statistics.c b/lib/statistics.c
index c35cca4..9d25b69 100644
--- a/lib/statistics.c
+++ b/lib/statistics.c
@@ -158,10 +158,10 @@ gal_statistics_float_second_max(float *in, size_t size, 
float *secondmax)
   do
     { /* Works for NAN, since NAN is not larger than any number. */
       if(*in>max)
-       {
-         smax=max;
-         max=*in;
-       }
+        {
+          smax=max;
+          max=*in;
+        }
       else if(*in>smax) smax=*in;
     }
   while(++in<fpt);
@@ -180,10 +180,10 @@ gal_statistics_float_second_min(float *in, size_t size, 
float *secondmin)
   do
     { /* Works for NAN, since NAN is not smaller than any number. */
       if(*in<min)
-       {
-         smin=min;
-         min=*in;
-       }
+        {
+          smin=min;
+          min=*in;
+        }
       else if(*in<smin) smin=*in;
     }
   while(++in<fpt);
@@ -260,8 +260,8 @@ gal_statistics_d_max_with_index(double *in, size_t size, 
double *max,
   do  /*  Works for NAN, see comments above. */
     if(*pt>tmax)
       {
-       tmax=*pt;
-       tindex=pt-in;
+        tmax=*pt;
+        tindex=pt-in;
       }
   while(++pt<fpt);
   *index=tindex;
@@ -283,8 +283,8 @@ gal_statistics_f_max_with_index(float *in, size_t size,
   do  /* Works for NAN, see comments above.x */
     if(*pt>tmax)
       {
-       tmax=*pt;
-       tindex=pt-in;
+        tmax=*pt;
+        tindex=pt-in;
       }
   while(++pt<fpt);
   *index=tindex;
@@ -306,8 +306,8 @@ gal_statistics_d_min_with_index(double *in, size_t size,
   do  /* Works for NAN, see comments above. */
     if(*pt<tmin)
       {
-       tmin=*pt;
-       tindex=pt-in;
+        tmin=*pt;
+        tindex=pt-in;
       }
   while(++pt<fpt);
   *index=tindex;
@@ -329,8 +329,8 @@ gal_statistics_f_min_with_index(float *in, size_t size,
   do /* Works for NAN, see comments above. */
     if(*pt<tmin)
       {
-       tmin=*pt;
-       tindex=pt-in;
+        tmin=*pt;
+        tindex=pt-in;
       }
   while(++pt<fpt);
   *index=tindex;
@@ -458,8 +458,8 @@ gal_statistics_float_sum_mask(float *in, unsigned char 
*mask,
   do
     if(*pt==0)
       {
-       sum+=in[pt-mask];
-       ++counter;
+        sum+=in[pt-mask];
+        ++counter;
       }
   while(++pt<fpt);
 
@@ -483,8 +483,8 @@ gal_statistics_float_sum_mask_l(float *in, long *mask,
   do
     if(*pt==0)
       {
-       sum+=in[pt-mask];
-       ++counter;
+        sum+=in[pt-mask];
+        ++counter;
       }
   while(++pt<fpt);
 
@@ -508,8 +508,8 @@ gal_statistics_float_sum_squared_mask(float *in, unsigned 
char *mask,
   do
     if(*pt==0)
       {
-       sum+=in[pt-mask] * in[pt-mask];
-       ++counter;
+        sum+=in[pt-mask] * in[pt-mask];
+        ++counter;
       }
   while(++pt<fpt);
 
@@ -534,8 +534,8 @@ gal_statistics_float_sum_squared_mask_l(float *in, long 
*mask,
   do
     if(*pt==0)
       {
-       sum+=in[pt-mask] * in[pt-mask];
-       ++counter;
+        sum+=in[pt-mask] * in[pt-mask];
+        ++counter;
       }
   while(++pt<fpt);
 
@@ -625,7 +625,7 @@ gal_statistics_f_ave_std(float *in, size_t size, float *ave,
       sum=gal_statistics_float_sum_mask(in, mask, size, &nsize1);
       sum2=gal_statistics_float_sum_squared_mask(in, mask, size, &nsize2);
       if(nsize1!=nsize2)
-       error(EXIT_FAILURE, 0, "a bug in gal_statistics_f_ave_std "
+        error(EXIT_FAILURE, 0, "a bug in gal_statistics_f_ave_std "
               "(lib/statistics.h).  Somehow the number of masked pixels is "
               "measured differently.  Please contact us so we can find the "
               "cause");
@@ -662,9 +662,9 @@ gal_statistics_f_ave_std_l(float *in, size_t size, float 
*ave,
       sum=gal_statistics_float_sum_mask_l(in, mask, size, &nsize1);
       sum2=gal_statistics_float_sum_squared_mask_l(in, mask, size, &nsize2);
       if(nsize1!=nsize2)
-       error(EXIT_FAILURE, 0, "a bug in favestl (lib/statistics.h). "
-             "Somehow the number of masked pixels is measured "
-             "differently. Please contact us so we can find the cause");
+        error(EXIT_FAILURE, 0, "a bug in favestl (lib/statistics.h). "
+              "Somehow the number of masked pixels is measured "
+              "differently. Please contact us so we can find the cause");
       size=nsize1;
     }
   *ave=sum/size;
@@ -698,15 +698,15 @@ gal_statistics_f_ave_std_mask_byt_0_in_region(float *in, 
unsigned char *byt,
       m=mask+startind;
       fb=(b=byt+startind)+s1;
       do
-       {
-       if(*m++==0 && *b==0)    /* `m` will definitely be checked and */
-         {                     /* incremented, while `b` might not.  */
-           size++;
-           sum   += *i;
-           sumsq += *i * *i;
-         }
-       ++i;
-       }
+        {
+        if(*m++==0 && *b==0)     /* `m` will definitely be checked and */
+          {                      /* incremented, while `b` might not.  */
+            size++;
+            sum   += *i;
+            sumsq += *i * *i;
+          }
+        ++i;
+        }
       while(++b<fb);
       startind+=is1;
     }
@@ -834,15 +834,15 @@ gal_statistics_set_bins(float *sorted, size_t size, 
size_t numbins,
   if(min==max)
     {
       if(quant!=0.0f)
-       {
-         min=sorted[ gal_statistics_index_from_quantile(size, quant)   ];
-         max=sorted[ gal_statistics_index_from_quantile(size, 1-quant) ];
-       }
+        {
+          min=sorted[ gal_statistics_index_from_quantile(size, quant)   ];
+          max=sorted[ gal_statistics_index_from_quantile(size, 1-quant) ];
+        }
       else
-       {
-         min=sorted[0];
-         max=sorted[size-1];
-       }
+        {
+          min=sorted[0];
+          max=sorted[size-1];
+        }
     }
   binwidth=(max-min)/numbins;
 
@@ -924,10 +924,10 @@ gal_statistics_histogram(float *sorted, size_t size, 
float *bins,
   if(maxhistone)
     {
       for(i=0;i<numbins;++i)
-       if(bins[i*2+1]>max)
-         max=bins[i*2+1];
+        if(bins[i*2+1]>max)
+          max=bins[i*2+1];
       for(i=0;i<numbins;++i)
-       bins[i*2+1]/=max;
+        bins[i*2+1]/=max;
     }
 
   /* In case you want to see the histogram:
@@ -1143,7 +1143,7 @@ gal_statistics_sigma_clip_converge(float *array, int 
o1_n0, size_t num_elem,
     {
       gal_arraymanip_float_copy(array, num_elem, &orderedarray);
       qsort(orderedarray, num_elem, sizeof*orderedarray,
-           gal_qsort_float_increasing);
+            gal_qsort_float_increasing);
     }
   else orderedarray=array;
 
@@ -1160,33 +1160,33 @@ gal_statistics_sigma_clip_converge(float *array, int 
o1_n0, size_t num_elem,
                counter+1, med, ave, std, num_elem);
 
       /* It might happen that ave and std are NaN. If so, stop the
-        process here (the user has not given a mask and some pixels
-        have nan values!). */
+         process here (the user has not given a mask and some pixels
+         have nan values!). */
       if(isnan(ave) || isnan(std))
-       return 0;
+        return 0;
 
       /* Normally, oldstd should be larger than std, because the
-        possible outliers have been removed. If it is not, it means
-        that we have clipped too much! */
+         possible outliers have been removed. If it is not, it means
+         that we have clipped too much! */
       if(counter>0 && (oldstd-std)/std<accuracy)
-       {
-         *outstd=oldstd; *outave=oldave; *outmed=oldmed;
-         return 1;
-       }
+        {
+          *outstd=oldstd; *outave=oldave; *outmed=oldmed;
+          return 1;
+        }
 
       for(dpt=start; dpt<start+num_elem; ++dpt)
-       if (*dpt>med-sigma_multiple*std)
-         {
-           start=dpt;
-           break;
-         }
+        if (*dpt>med-sigma_multiple*std)
+          {
+            start=dpt;
+            break;
+          }
 
       for(dpt=oldstart+num_elem-1;dpt>start;dpt--)
-       if (*dpt<med+sigma_multiple*std)
-         {
-           num_elem=dpt-start+1;
-           break;
-         }
+        if (*dpt<med+sigma_multiple*std)
+          {
+            num_elem=dpt-start+1;
+            break;
+          }
 
       oldave=ave;
       oldmed=med;
@@ -1217,7 +1217,7 @@ gal_statistics_sigma_clip_certain_num(float *array, int 
o1_n0, size_t num_elem,
     {
       gal_arraymanip_float_copy(array, num_elem, &orderedarray);
       qsort(orderedarray, num_elem, sizeof*orderedarray,
-           gal_qsort_float_increasing);
+            gal_qsort_float_increasing);
     }
   else orderedarray=array;
 
@@ -1234,26 +1234,26 @@ gal_statistics_sigma_clip_certain_num(float *array, int 
o1_n0, size_t num_elem,
                counter+1, med, ave, std, num_elem);
 
       /* It might happen that ave and std are nan. If so, stop the
-        process here (the user has not given a mask and some pixels
-        have nan values!). */
+         process here (the user has not given a mask and some pixels
+         have nan values!). */
       if(isnan(ave) || isnan(std))
-       return 0;
+        return 0;
 
 
       for(dpt=start; dpt<start+num_elem; ++dpt)
-       if (*dpt>med-sigma_multiple*std)
-         {
-           start=dpt;
-           break;
-         }
+        if (*dpt>med-sigma_multiple*std)
+          {
+            start=dpt;
+            break;
+          }
 
 
       for(dpt=oldstart+num_elem-1;dpt>start;dpt--)
-       if (*dpt<med+sigma_multiple*std)
-         {
-           num_elem=dpt-start+1;
-           break;
-         }
+        if (*dpt<med+sigma_multiple*std)
+          {
+            num_elem=dpt-start+1;
+            break;
+          }
     }
 
   if(o1_n0==0)
@@ -1326,10 +1326,10 @@ gal_statistics_remove_outliers_flat_cdf(float *sorted, 
size_t *outsize)
   for(i=maxind+1;i<size-1;++i)
     if(slopes[i]<minslope)
       {
-       if(firstfound)
-         break;
-       else
-         firstfound=1;
+        if(firstfound)
+          break;
+        else
+          firstfound=1;
       }
   *outsize=i+1;
 
diff --git a/lib/threads.c b/lib/threads.c
index 8eebe4f..208dfda 100644
--- a/lib/threads.c
+++ b/lib/threads.c
@@ -143,7 +143,7 @@ pthread_barrier_wait(pthread_barrier_t *b)
    (size_t) -1, which is larger than any possible index!. */
 void
 gal_threads_dist_in_threads(size_t nindexs, size_t nthrds, size_t **outthrds,
-             size_t *outthrdcols)
+              size_t *outthrdcols)
 {
   size_t *sp, *fp;
   size_t i, *thrds, thrdcols;
@@ -169,7 +169,7 @@ gal_threads_dist_in_threads(size_t nindexs, size_t nthrds, 
size_t **outthrds,
       printf("\n\n############################\n");
       printf("THREAD %lu: \n", i);
       for(j=0;thrds[i*thrdcols+j]!=GAL_THREADS_NON_THRD_INDEX;j++)
-       printf("%lu, ", thrds[i*thrdcols+j]);
+        printf("%lu, ", thrds[i*thrdcols+j]);
       printf("\b\b.\n");
     }
   exit(0);
@@ -182,7 +182,7 @@ gal_threads_dist_in_threads(size_t nindexs, size_t nthrds, 
size_t **outthrds,
 
 void
 gal_threads_attr_barrier_init(pthread_attr_t *attr, pthread_barrier_t *b,
-               size_t numthreads)
+                              size_t numthreads)
 {
   int err;
 
diff --git a/lib/timing.c b/lib/timing.c
index d5e4d25..30ed199 100644
--- a/lib/timing.c
+++ b/lib/timing.c
@@ -53,7 +53,7 @@ gal_timing_report(struct timeval *t1, char *jobname, size_t 
level)
       gettimeofday(&t2, NULL);
 
       dt= ( ((double)t2.tv_sec+(double)t2.tv_usec/1e6) -
-           ((double)t1->tv_sec+(double)t1->tv_usec/1e6) );
+            ((double)t1->tv_sec+(double)t1->tv_usec/1e6) );
     }
 
   if(level==0)
@@ -61,10 +61,10 @@ gal_timing_report(struct timeval *t1, char *jobname, size_t 
level)
   else if(level==1)
     {
       if(t1)
-       printf("  - %-"GAL_TIMING_VERB_MSG_LENGTH_T"s %f seconds\n",
+        printf("  - %-"GAL_TIMING_VERB_MSG_LENGTH_T"s %f seconds\n",
                jobname, dt);
       else
-       printf("  - %-"GAL_TIMING_VERB_MSG_LENGTH_T"s\n", jobname);
+        printf("  - %-"GAL_TIMING_VERB_MSG_LENGTH_T"s\n", jobname);
     }
   else if(level==2)
     printf("  ---- %s\n", jobname);
diff --git a/lib/txtarray.c b/lib/txtarray.c
index 47012ee..a8d816b 100644
--- a/lib/txtarray.c
+++ b/lib/txtarray.c
@@ -63,7 +63,7 @@ txttablesize(char *filename, size_t *outs0, size_t *outs1)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   /* Open the file: */
   errno=0;
@@ -77,21 +77,21 @@ txttablesize(char *filename, size_t *outs0, size_t *outs1)
       firsttoken=strtok(line, GAL_TXTARRAY_DELIMITERS);
 
       /* If there are no non-delimters in the line (can happen if the
-        line is a blank line in the end of the file). */
+         line is a blank line in the end of the file). */
       if(firsttoken==NULL)
-       continue;
+        continue;
 
       /* Check if it is a comment or new line character: */
       if(firsttoken[0]=='#')
-       continue;
+        continue;
 
       /* We are now in a data row: */
       if(s0==0)  /* We are on the first row of data, find s1. */
-       {
-         s1=1;
-         while( strtok(NULL, GAL_TXTARRAY_DELIMITERS) != NULL )
-           ++s1;
-       }
+        {
+          s1=1;
+          while( strtok(NULL, GAL_TXTARRAY_DELIMITERS) != NULL )
+            ++s1;
+        }
       ++s0;
     }
   free(line);
@@ -113,26 +113,26 @@ txttablesize(char *filename, size_t *outs0, size_t *outs1)
 
 void
 savetolog(FILE **log, char *filename, size_t lineno, size_t s0,
-         size_t s1, char *token)
+          size_t s1, char *token)
 {
-  if(*log)                     /* The file is already open. */
+  if(*log)                        /* The file is already open. */
     fprintf(*log, "%-10lu%-10lu%-10lu%s\n", lineno, s0, s1, token);
-  else                         /* Not yet created.          */
+  else                            /* Not yet created.          */
     {
       errno=0;
       *log=fopen(GAL_TXTARRAY_LOG, "w");
       if(*log==NULL)
-       error(EXIT_FAILURE, errno, "%s", filename);
+        error(EXIT_FAILURE, errno, "%s", filename);
       fprintf(*log, "# Elements in %s which could not be read as a \n"
-             "# number. They are saved as nan in the array.\n"
-             "# The columns in the table below are:\n"
-             "# 0: Line number in file.\n"
-             "# 1: Row number in table (without commented or blank "
+              "# number. They are saved as nan in the array.\n"
+              "# The columns in the table below are:\n"
+              "# 0: Line number in file.\n"
+              "# 1: Row number in table (without commented or blank "
               "lines).\n"
-             "# 2: Column number in table.\n"
-             "# 3: The string that could not be converted to a number.\n"
-             "# Note that counting starts from zero.\n",
-             filename);
+              "# 2: Column number in table.\n"
+              "# 3: The string that could not be converted to a number.\n"
+              "# Note that counting starts from zero.\n",
+              filename);
       fprintf(*log, "%-10lu%-10lu%-10lu%s\n", lineno-1, s0, s1, token);
     }
 }
@@ -142,17 +142,17 @@ savetolog(FILE **log, char *filename, size_t lineno, 
size_t s0,
 
 
 /* Macro functions: */
-#define CONVERTANDSAVE {                                               \
-  errno=0; tailptr=NULL;                                               \
-  array[ts0*s1+ts1]=strtod(token, &tailptr);                           \
-  if(errno)                                                            \
+#define CONVERTANDSAVE {                                                \
+    errno=0; tailptr=NULL;                                              \
+  array[ts0*s1+ts1]=strtod(token, &tailptr);                            \
+  if(errno)                                                             \
     error_at_line(EXIT_FAILURE, errno, "%s", lineno, token, filename);  \
-  if(*tailptr!='\0')                                                   \
-    {                                                                  \
-      savetolog(&log, filename, lineno, ts0, ts1, token);              \
-      array[ts0*s1+ts1]=NAN;                                           \
-    }                                                                  \
-  ++ts1;                                                               \
+  if(*tailptr!='\0')                                                    \
+    {                                                                   \
+      savetolog(&log, filename, lineno, ts0, ts1, token);               \
+      array[ts0*s1+ts1]=NAN;                                            \
+    }                                                                   \
+  ++ts1;                                                                \
   }
 
 
@@ -180,7 +180,7 @@ filltable(char *filename, double *array, size_t s0, size_t 
s1)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   ts0=0;
   while( getline(&line, &len, fp) != -1 )
@@ -192,32 +192,32 @@ filltable(char *filename, double *array, size_t s0, 
size_t s1)
       token=strtok(line, GAL_TXTARRAY_DELIMITERS);
 
       /* If there are no non-delimters in the line (can happen if the
-        line is a blank line in the end of the file). */
+         line is a blank line in the end of the file). */
       if(token==NULL)
-       continue;
+        continue;
 
       /* Check if it is a comment or new line character: */
       if(token[0]=='#')
-       continue;
+        continue;
 
       /* Convert the first token and put it into the array: */
       CONVERTANDSAVE;
 
       /* Read the rest of the tokens: */
       while( (token=strtok(NULL, GAL_TXTARRAY_DELIMITERS))!=NULL )
-       {
-         if(ts1>=s1)
-           error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                         "Too many columns on this line. The number of "
-                         "columns should be the same as the first row "
-                         "of the table.");
-         CONVERTANDSAVE;
-       }
-      if(ts1<s1-1)             /* It should be s1-1. */
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     "Not enough columns on this line. The number of "
-                     "columns should be the same as the first row "
-                     "of the table.");
+        {
+          if(ts1>=s1)
+            error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                          "Too many columns on this line. The number of "
+                          "columns should be the same as the first row "
+                          "of the table.");
+          CONVERTANDSAVE;
+        }
+      if(ts1<s1-1)                /* It should be s1-1. */
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      "Not enough columns on this line. The number of "
+                      "columns should be the same as the first row "
+                      "of the table.");
       ++ts0;
     }
   free(line);
@@ -229,7 +229,7 @@ filltable(char *filename, double *array, size_t s0, size_t 
s1)
     {
       errno=0;
       if(fclose(log)==EOF)
-       error(EXIT_FAILURE, errno, "%s", GAL_TXTARRAY_LOG);
+        error(EXIT_FAILURE, errno, "%s", GAL_TXTARRAY_LOG);
     }
 }
 
@@ -245,8 +245,8 @@ gal_txtarray_txt_to_array(char *filename, double **array,
   errno=0;
   txttablesize(filename, s0, s1);
   if( (*array=malloc(*s0 * *s1 * sizeof **array)) == NULL)
-    error(EXIT_FAILURE, errno, "gal_txtarray_txt_to_array: space for array "
-          "with %lu elements", *s0 * *s1);
+    error(EXIT_FAILURE, errno, "gal_txtarray_txt_to_array: space for "
+          "array with %lu elements", *s0 * *s1);
 
   /* Fill in the table with the contents of the text file: */
   filltable(filename, *array, *s0, *s1);
@@ -279,7 +279,7 @@ gal_txtarray_txt_to_array(char *filename, double **array,
    is suitable for printing.  */
 void
 doformatting(int numcols, char **fmt, int *int_cols, int *accu_cols,
-            int *space, int *prec, char forg)
+             int *space, int *prec, char forg)
 {
   int i,j, found=0;
 
@@ -290,18 +290,18 @@ doformatting(int numcols, char **fmt, int *int_cols, int 
*accu_cols,
       errno=0;
       fmt[i]=malloc(GAL_TXTARRAY_FMT_LENGTH * sizeof(char));
       if(fmt[i]==NULL)
-       error(EXIT_FAILURE, errno, "txtarray, space for format "
-             "string %d, with %d elements", i, GAL_TXTARRAY_FMT_LENGTH);
+        error(EXIT_FAILURE, errno, "txtarray, space for format "
+              "string %d, with %d elements", i, GAL_TXTARRAY_FMT_LENGTH);
 
       /* See if this is an int column. */
       found=0;
       for(j=0;j<numcols;++j)
         {
-         if (int_cols[j]<0) break;
-         if (i==int_cols[j])
+          if (int_cols[j]<0) break;
+          if (i==int_cols[j])
             {
-             sprintf(fmt[i], "%%-%d.0%c", space[0], forg);
-             found=1;break;
+              sprintf(fmt[i], "%%-%d.0%c", space[0], forg);
+              found=1;break;
             }
         }
       if (found==1) continue;
@@ -310,11 +310,11 @@ doformatting(int numcols, char **fmt, int *int_cols, int 
*accu_cols,
       found=0;
       for(j=0;j<numcols;++j)
         {
-         if (accu_cols[j]<0) break;
-         if (i==accu_cols[j])
+          if (accu_cols[j]<0) break;
+          if (i==accu_cols[j])
             {
-             sprintf(fmt[i], "%%-%d.%d%c", space[2], prec[1], forg);
-             found=1;break;
+              sprintf(fmt[i], "%%-%d.%d%c", space[2], prec[1], forg);
+              found=1;break;
             }
         }
       if (found==1) continue;
@@ -352,9 +352,10 @@ doformatting(int numcols, char **fmt, int *int_cols, int 
*accu_cols,
 
  */
 void
-gal_txtarray_array_to_txt(double *array, size_t s0, size_t s1, char *comments,
-                          int *int_cols, int *accu_cols, int *space, int *prec,
-                          char forg, const char *filename)
+gal_txtarray_array_to_txt(double *array, size_t s0, size_t s1,
+                          char *comments, int *int_cols, int *accu_cols,
+                          int *space, int *prec, char forg,
+                          const char *filename)
 {
   int i,j;
   FILE *fp;
@@ -363,27 +364,29 @@ gal_txtarray_array_to_txt(double *array, size_t s0, 
size_t s1, char *comments,
   /* Do a small sanity check: */
   for(i=0;int_cols[i]>0;++i)
     if(int_cols[i]>=s1)
-      error(EXIT_FAILURE, 0, "gal_txtarray_array_to_txt: In int_cols[], %d is "
-           "larger than the number of columns: %lu", int_cols[i], s1);
+      error(EXIT_FAILURE, 0, "gal_txtarray_array_to_txt: In int_cols[], "
+            "%d is larger than the number of columns: %lu", int_cols[i],
+            s1);
   for(i=0;accu_cols[i]>0;++i)
     if(accu_cols[i]>=s1)
-      error(EXIT_FAILURE, 0, "gal_txtarray_array_to_txt: In accu_cols[], %d is 
"
-           "larger than the number of columns: %lu", accu_cols[i], s1);
+      error(EXIT_FAILURE, 0, "gal_txtarray_array_to_txt: In accu_cols[], "
+            "%d is larger than the number of columns: %lu", accu_cols[i],
+            s1);
   for(i=0;i<3;++i)
     if(space[i]<=0)
-      error(EXIT_FAILURE, 0, "gal_txtarray_array_to_txt: In space[], %d is "
-           "smaller or equal to zero", space[i]);
+      error(EXIT_FAILURE, 0, "gal_txtarray_array_to_txt: In space[], %d "
+            "is smaller or equal to zero", space[i]);
   for(i=0;i<2;++i)
     if(prec[i]<0)
       error(EXIT_FAILURE, 0, "gal_txtarray_array_to_txt: In prec[], %d is "
-           "smaller than zero", space[i]);
+            "smaller than zero", space[i]);
 
   /* Allocate the spaces: */
   errno=0;
   fmt=malloc(s1 * sizeof(char *));
   if(fmt==NULL)
     error(EXIT_FAILURE, errno, "txtarray, formatting of each "
-         "column with %lu elements", s1);
+          "column with %lu elements", s1);
 
   /* Prepare the formatting for each column */
   doformatting(s1, fmt, int_cols, accu_cols, space, prec, forg);
@@ -404,7 +407,7 @@ gal_txtarray_array_to_txt(double *array, size_t s0, size_t 
s1, char *comments,
   for(i=0;i<s0;++i)
     {
       for(j=0;j<s1;++j)
-       fprintf(fp, fmt[j], array[i*s1+j]);
+        fprintf(fp, fmt[j], array[i*s1+j]);
       fprintf(fp, "\n");
     }
 
diff --git a/src/arithmetic/args.h b/src/arithmetic/args.h
index ff096bd..bec5af0 100644
--- a/src/arithmetic/args.h
+++ b/src/arithmetic/args.h
@@ -165,9 +165,9 @@ parse_opt(int key, char *arg, struct argp_state *state)
      user is warned and the program is stopped: */
   if(arg && arg[0]=='=')
     argp_error(state, "incorrect use of the equal sign (`=`). For short "
-              "options, `=` should not be used and for long options, "
-              "there should be no space between the option, equal sign "
-              "and value");
+               "options, `=` should not be used and for long options, "
+               "there should be no space between the option, equal sign "
+               "and value");
 
   switch(key)
     {
@@ -213,11 +213,11 @@ parse_opt(int key, char *arg, struct argp_state *state)
     /* The command line options and arguments are finished. */
     case ARGP_KEY_END:
       if(p->cp.setdirconf==0 && p->cp.setusrconf==0
-        && p->cp.printparams==0)
-       {
-         if(state->arg_num==0)
-           argp_error(state, "no argument given");
-       }
+         && p->cp.printparams==0)
+        {
+          if(state->arg_num==0)
+            argp_error(state, "no argument given");
+        }
       break;
 
 
@@ -249,6 +249,6 @@ struct argp_child children[]=
 
 /* Basic structure defining the whole argument reading process. */
 static struct argp thisargp = {options, parse_opt, args_doc,
-                              doc, children, NULL, NULL};
+                               doc, children, NULL, NULL};
 
 #endif
diff --git a/src/arithmetic/cite.h b/src/arithmetic/cite.h
index 90e961c..5e853ef 100644
--- a/src/arithmetic/cite.h
+++ b/src/arithmetic/cite.h
@@ -25,14 +25,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #define ARITHMETICBIBTEX ""
 
-#define PRINTCITEABORT {                                               \
-    printf("\nWe hope %s has been useful for your research.\n"         \
-          "Citations are vital for the continued work on %s.\n"        \
-          "Thank you for citing it in your research paper.\n"          \
-          "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
-          SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
-           GAL_STRINGS_MAIN_BIBTEX, ARITHMETICBIBTEX);                 \
-    exit(EXIT_SUCCESS);                                                        
\
-}
+#define PRINTCITEABORT {                                                \
+    printf("\nWe hope %s has been useful for your research.\n"          \
+           "Citations are vital for the continued work on %s.\n"        \
+           "Thank you for citing it in your research paper.\n"          \
+           "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
+           SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
+           GAL_STRINGS_MAIN_BIBTEX, ARITHMETICBIBTEX);                  \
+    exit(EXIT_SUCCESS);                                                 \
+  }
 
 #endif
diff --git a/src/arithmetic/main.c b/src/arithmetic/main.c
index d928534..d82ae02 100644
--- a/src/arithmetic/main.c
+++ b/src/arithmetic/main.c
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* needs main.h.                  */
+#include "ui.h"                 /* needs main.h.                  */
 #include "arithmetic.h"         /* needs main.h.                  */
 
 int
diff --git a/src/arithmetic/ui.c b/src/arithmetic/ui.c
index 1a8f14d..54a0f1a 100644
--- a/src/arithmetic/ui.c
+++ b/src/arithmetic/ui.c
@@ -30,10 +30,10 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <string.h>
 #include <fitsio.h>
 
-#include <nproc.h>              /* From Gnulib.                     */
+#include <nproc.h>               /* From Gnulib.                   */
 
 #include <gnuastro/fits.h>
-#include <gnuastro/timing.h>    /* Includes time.h and sys/time.h   */
+#include <gnuastro/timing.h>     /* Includes time.h and sys/time.h */
 #include <gnuastro/checkset.h>
 #include <gnuastro/commonargs.h>
 #include <gnuastro/configfiles.h>
@@ -41,8 +41,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* Needs main.h                   */
-#include "args.h"              /* Needs main.h, includes argp.h. */
+#include "ui.h"                  /* Needs main.h                   */
+#include "args.h"                /* Needs main.h, includes argp.h. */
 
 
 /* Set the file names of the places where the default parameters are
@@ -73,7 +73,7 @@ readconfig(char *filename, struct imgarithparams *p)
   char *line, *name, *value;
   struct uiparams *up=&p->up;
   struct gal_commonparams *cp=&p->cp;
-  char key='a';        /* Not used, just a place holder. */
+  char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
      might be intentional, so there is no error. If a parameter is
@@ -90,7 +90,7 @@ readconfig(char *filename, struct imgarithparams *p)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   /* Read the tokens in the file:  */
   while(getline(&line, &len, fp) != -1)
@@ -120,7 +120,8 @@ readconfig(char *filename, struct imgarithparams *p)
 
       /* Outputs */
       else if(strcmp(name, "output")==0)
-        gal_checkset_allocate_copy_set(value, &cp->output, &cp->outputset);
+        gal_checkset_allocate_copy_set(value, &cp->output,
+                                       &cp->outputset);
 
 
       /* Operating modes: */
@@ -129,8 +130,8 @@ readconfig(char *filename, struct imgarithparams *p)
 
 
       else
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     "`%s` not recognized.\n", name);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      "`%s` not recognized.\n", name);
     }
 
   free(line);
@@ -293,8 +294,8 @@ sanitycheck(struct imgarithparams *p)
     {
       /* Set the p->up.maskname accordingly: */
       gal_fits_file_or_ext_name(token->v, p->cp.hdu,
-                                     p->up.masknameset, &p->up.maskname,
-                                     p->up.mhdu, p->up.mhduset, "mask");
+                                p->up.masknameset, &p->up.maskname,
+                                p->up.mhdu, p->up.mhduset, "mask");
 
       /* Set the name of the output file: */
       if(p->cp.outputset)
diff --git a/src/convertt/args.h b/src/convertt/args.h
index af53594..98ec095 100644
--- a/src/convertt/args.h
+++ b/src/convertt/args.h
@@ -269,9 +269,9 @@ parse_opt(int key, char *arg, struct argp_state *state)
      user is warned and the program is stopped: */
   if(arg && arg[0]=='=')
     argp_error(state, "incorrect use of the equal sign (`=`). For short "
-              "options, `=` should not be used and for long options, "
-              "there should be no space between the option, equal sign "
-              "and value");
+               "options, `=` should not be used and for long options, "
+               "there should be no space between the option, equal sign "
+               "and value");
 
   switch(key)
     {
@@ -362,13 +362,13 @@ parse_opt(int key, char *arg, struct argp_state *state)
     /* The command line options and arguments are finished. */
     case ARGP_KEY_END:
       if(p->cp.setdirconf==0 && p->cp.setusrconf==0
-        && p->cp.printparams==0)
-       {
-         if(state->arg_num==0)
-           argp_error(state, "no argument given");
-         if(p->inputnames==NULL)
-           argp_error(state, "no input files provided");
-       }
+         && p->cp.printparams==0)
+        {
+          if(state->arg_num==0)
+            argp_error(state, "no argument given");
+          if(p->inputnames==NULL)
+            argp_error(state, "no input files provided");
+        }
       break;
 
 
@@ -399,6 +399,6 @@ struct argp_child children[]=
 
 /* Basic structure defining the whole argument reading process. */
 static struct argp thisargp = {options, parse_opt, args_doc,
-                              doc, children, NULL, NULL};
+                               doc, children, NULL, NULL};
 
 #endif
diff --git a/src/convertt/cite.h b/src/convertt/cite.h
index fa5054b..2a98ece 100644
--- a/src/convertt/cite.h
+++ b/src/convertt/cite.h
@@ -25,14 +25,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #define CONVERTTBIBTEX ""
 
-#define PRINTCITEABORT {                                               \
-    printf("\nWe hope %s has been useful for your research.\n"         \
-          "Citations are vital for the continued work on %s.\n"        \
-          "Thank you for citing it in your research paper.\n"          \
-          "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
-          SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
-           GAL_STRINGS_MAIN_BIBTEX, CONVERTTBIBTEX);                   \
-    exit(EXIT_SUCCESS);                                                        
\
+#define PRINTCITEABORT {                                                \
+    printf("\nWe hope %s has been useful for your research.\n"          \
+           "Citations are vital for the continued work on %s.\n"        \
+           "Thank you for citing it in your research paper.\n"          \
+           "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
+           SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
+           GAL_STRINGS_MAIN_BIBTEX, CONVERTTBIBTEX);                    \
+    exit(EXIT_SUCCESS);                                                 \
 }
 
 #endif
diff --git a/src/convertt/jpeg.c b/src/convertt/jpeg.c
index 3701f31..ca2c3bf 100644
--- a/src/convertt/jpeg.c
+++ b/src/convertt/jpeg.c
@@ -109,8 +109,8 @@ nameisjpegsuffix(char *name)
    details of what is going on here.  */
 struct my_error_mgr
 {
-  struct jpeg_error_mgr pub;   /* "public" fields */
-  jmp_buf setjmp_buffer;       /* for return to caller */
+  struct jpeg_error_mgr pub;        /* "public" fields */
+  jmp_buf setjmp_buffer;            /* for return to caller */
 };
 
 typedef struct my_error_mgr *my_error_ptr;
diff --git a/src/convertt/main.c b/src/convertt/main.c
index 4bb2e47..270e112 100644
--- a/src/convertt/main.c
+++ b/src/convertt/main.c
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* needs main.h.                  */
+#include "ui.h"                  /* needs main.h.                  */
 #include "convertt.h"
 
 int
diff --git a/src/convertt/ui.c b/src/convertt/ui.c
index 5f679a3..0a943f8 100644
--- a/src/convertt/ui.c
+++ b/src/convertt/ui.c
@@ -69,7 +69,7 @@ readconfig(char *filename, struct converttparams *p)
   char *line, *name, *value;
   struct uiparams *up=&p->up;
   struct gal_commonparams *cp=&p->cp;
-  char key='a';        /* Not used, just a place holder. */
+  char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
      might be intentional, so there is no error. If a parameter is
@@ -86,7 +86,7 @@ readconfig(char *filename, struct converttparams *p)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   /* Read the tokens in the file:  */
   while(getline(&line, &len, fp) != -1)
@@ -110,28 +110,29 @@ readconfig(char *filename, struct converttparams *p)
         gal_checkset_allocate_copy_set(value, &cp->output, &cp->outputset);
 
       else if(strcmp(name, "quality")==0)
-       {
-         if(up->qualityset) continue;
+        {
+          if(up->qualityset) continue;
           gal_checkset_int_smaller_equal_to(value, &p->quality, name, key,
-                                            p->cp.spack, filename, lineno, 
100);
+                                            p->cp.spack, filename, lineno,
+                                            100);
           if(p->quality<0)
             error(EXIT_FAILURE, 0, "the quality option should be positive");
-         up->qualityset=1;
-       }
+          up->qualityset=1;
+        }
       else if(strcmp(name, "widthincm")==0)
-       {
-         if(up->widthincmset) continue;
+        {
+          if(up->widthincmset) continue;
           gal_checkset_float_l_0(value, &p->widthincm, name, key, SPACK,
                                  filename, lineno);
-         up->widthincmset=1;
-       }
+          up->widthincmset=1;
+        }
       else if(strcmp(name, "borderwidth")==0)
-       {
-         if(up->borderwidthset) continue;
+        {
+          if(up->borderwidthset) continue;
           gal_checkset_int_el_zero(value, &p->borderwidth, name, key, SPACK,
                                    filename, lineno);
-         up->borderwidthset=1;
-       }
+          up->borderwidthset=1;
+        }
 
 
 
@@ -139,29 +140,29 @@ readconfig(char *filename, struct converttparams *p)
 
       /* Flux: */
       else if(strcmp(name, "fluxlow")==0)
-       {
-         if(up->fluxlowset) continue;
-          gal_checkset_any_double(value, &p->fluxlow, name, key, p->cp.spack,
-                                  filename, lineno);
+        {
+          if(up->fluxlowset) continue;
+          gal_checkset_any_double(value, &p->fluxlow, name, key,
+                                  p->cp.spack, filename, lineno);
           up->fluxlowset=1;
-       }
+        }
       else if(strcmp(name, "fluxhigh")==0)
-       {
-         if(up->fluxhighset) continue;
-          gal_checkset_any_double(value, &p->fluxhigh, name, key, p->cp.spack,
-                                  filename, lineno);
+        {
+          if(up->fluxhighset) continue;
+          gal_checkset_any_double(value, &p->fluxhigh, name, key,
+                                  p->cp.spack, filename, lineno);
           up->fluxhighset=1;
-       }
+        }
       else if(strcmp(name, "maxbyte")==0)
-       {
-         if(up->maxbyteset) continue;
+        {
+          if(up->maxbyteset) continue;
           gal_checkset_int_smaller_equal_to(value, &tmp, "maxbyte", key,
                                             p->cp.spack, NULL, 0, UINT8_MAX);
           if(tmp<0)
             error(EXIT_FAILURE, 0, "--maxbyte (-m) should be positive");
           p->maxbyte=tmp;
           p->up.maxbyteset=1;
-       }
+        }
 
 
 
@@ -171,8 +172,8 @@ readconfig(char *filename, struct converttparams *p)
 
 
       else
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     "`%s` not recognized.\n", name);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      "`%s` not recognized.\n", name);
     }
 
   free(line);
@@ -303,22 +304,22 @@ makechangestruct(char *arg)
       while(*p==' ') {++p; continue;}
       if(*p==':') ++p;
       else
-       {
-         fprintf(stderr, PACKAGE": In the conversion option, [from] "
-                 "and [to] values should be separated by a ':'. You "
-                 "have given a '%c': %s\n", *p, arg);
-         exit(EXIT_FAILURE);
-       }
+        {
+          fprintf(stderr, PACKAGE": In the conversion option, [from] "
+                  "and [to] values should be separated by a ':'. You "
+                  "have given a '%c': %s\n", *p, arg);
+          exit(EXIT_FAILURE);
+        }
       c->to=strtof(p, &p);
       while(*p==' ') {++p; continue;}
       if(*p==',') p++;
       else if(*p!='\0')
-       {
-         fprintf(stderr, PACKAGE": In the conversion option, [from] "
-                 "and [to] pairs should be separated by a ','. You have "
-                 "provided a '%c': %s\n", *p, arg);
-         exit(EXIT_FAILURE);
-       }
+        {
+          fprintf(stderr, PACKAGE": In the conversion option, [from] "
+                  "and [to] pairs should be separated by a ','. You have "
+                  "provided a '%c': %s\n", *p, arg);
+          exit(EXIT_FAILURE);
+        }
       c->next=out;
       out=c;
     }
@@ -387,7 +388,7 @@ adddotautomaticoutput(struct converttparams *p)
 
   /* Set the automatic output and make sure we have write access. */
   gal_checkset_automatic_output(basename, cp->output, cp->removedirinfo,
-                  cp->dontdelete, &cp->output);
+                                cp->dontdelete, &cp->output);
   if( gal_checkset_dir_0_file_1(cp->output, cp->dontdelete)==0 )
     error(EXIT_FAILURE, 0, "%s is a directory", cp->output);
 }
@@ -469,11 +470,11 @@ sanitycheck(struct converttparams *p)
       else if(nameisjpeg(cp->output))
         {
 #ifndef HAS_LIBJPEG
-          error(EXIT_FAILURE, 0, "you have asked for a JPEG output, however, "
-                "when %s was configured libjpeg was not available. To write "
-                "to JPEG files, libjpeg is required. Please install it and "
-                "configure, make and install %s again", PACKAGE_STRING,
-                PACKAGE_STRING);
+          error(EXIT_FAILURE, 0, "you have asked for a JPEG output, "
+                "however, when %s was configured libjpeg was not "
+                "available. To write to JPEG files, libjpeg is required. "
+                "Please install it and configure, make and install %s "
+                "again", PACKAGE_STRING, PACKAGE_STRING);
 #else
           p->outputtype=JPEGFORMAT;
           if( nameisjpegsuffix(cp->output) )
@@ -589,11 +590,12 @@ preparearrays(struct converttparams *p)
             }
           p->numnul[p->numch]=
             gal_fits_hdu_to_array(names[i], hdu, &p->bitpixs[p->numch],
-                                  &array, &p->s0[p->numch], &p->s1[p->numch]);
+                                  &array, &p->s0[p->numch],
+                                  &p->s1[p->numch]);
           gal_fits_change_type(array, p->bitpixs[p->numch],
-                                    p->s0[p->numch]*p->s1[p->numch],
-                                    p->numnul[p->numch],
-                                    (void **)(&p->ch[p->numch]), DOUBLE_IMG);
+                               p->s0[p->numch]*p->s1[p->numch],
+                               p->numnul[p->numch],
+                               (void **)(&p->ch[p->numch]), DOUBLE_IMG);
           free(array);
           ++p->numch;
         }
@@ -606,8 +608,8 @@ preparearrays(struct converttparams *p)
 #ifndef HAS_LIBJPEG
           error(EXIT_FAILURE, 0, "you are giving a JPEG input, however, "
                 "when %s was configured libjpeg was not available. To read "
-                "from JPEG files, libjpeg is required. Please install it and "
-                "configure, make and install %s again", PACKAGE_STRING,
+                "from JPEG files, libjpeg is required. Please install it "
+                "and configure, make and install %s again", PACKAGE_STRING,
                 PACKAGE_STRING);
 #else
           preparejpeg(p, names[i]);
diff --git a/src/convolve/args.h b/src/convolve/args.h
index adc86b7..da380d2 100644
--- a/src/convolve/args.h
+++ b/src/convolve/args.h
@@ -264,9 +264,9 @@ parse_opt(int key, char *arg, struct argp_state *state)
      user is warned and the program is stopped: */
   if(arg && arg[0]=='=')
     argp_error(state, "incorrect use of the equal sign (`=`). For short "
-              "options, `=` should not be used and for long options, "
-              "there should be no space between the option, equal sign "
-              "and value");
+               "options, `=` should not be used and for long options, "
+               "there should be no space between the option, equal sign "
+               "and value");
 
   switch(key)
     {
@@ -327,7 +327,7 @@ parse_opt(int key, char *arg, struct argp_state *state)
    /* Operating mode: */
     case 'p':
       if(p->up.frequencyset)
-       argp_error(state, "only one of spatial or frequency domain "
+        argp_error(state, "only one of spatial or frequency domain "
                    "convolution modes may be chosen");
       p->spatial=1;
       p->frequency=0;
@@ -335,7 +335,7 @@ parse_opt(int key, char *arg, struct argp_state *state)
       break;
     case 'f':
       if(p->up.spatialset)
-       argp_error(state, "only one of spatial or frequency domain "
+        argp_error(state, "only one of spatial or frequency domain "
                    "convolution modes may be chosen");
       p->spatial=0;
       p->frequency=1;
@@ -368,13 +368,13 @@ parse_opt(int key, char *arg, struct argp_state *state)
     /* The command line options and arguments are finished. */
     case ARGP_KEY_END:
       if(p->cp.setdirconf==0 && p->cp.setusrconf==0
-        && p->cp.printparams==0)
-       {
-         if(state->arg_num==0)
-           argp_error(state, "no argument given");
-         if(p->up.inputname==NULL)
-           argp_error(state, "no input files provided");
-       }
+         && p->cp.printparams==0)
+        {
+          if(state->arg_num==0)
+            argp_error(state, "no argument given");
+          if(p->up.inputname==NULL)
+            argp_error(state, "no input files provided");
+        }
       break;
 
 
@@ -405,6 +405,6 @@ struct argp_child children[]=
 
 /* Basic structure defining the whole argument reading process. */
 static struct argp thisargp = {options, parse_opt, args_doc,
-                              doc, children, NULL, NULL};
+                               doc, children, NULL, NULL};
 
 #endif
diff --git a/src/convolve/cite.h b/src/convolve/cite.h
index cb319f1..1139592 100644
--- a/src/convolve/cite.h
+++ b/src/convolve/cite.h
@@ -25,14 +25,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.x
 
 #define CONVOLVEBIBTEX ""
 
-#define PRINTCITEABORT {                                               \
-    printf("\nWe hope %s has been useful for your research.\n"         \
-          "Citations are vital for the continued work on %s.\n"        \
-          "Thank you for citing it in your research paper.\n"          \
-          "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
-          SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
-           GAL_STRINGS_MAIN_BIBTEX, CONVOLVEBIBTEX);                   \
-    exit(EXIT_SUCCESS);                                                        
\
+#define PRINTCITEABORT {                                                \
+    printf("\nWe hope %s has been useful for your research.\n"          \
+           "Citations are vital for the continued work on %s.\n"        \
+           "Thank you for citing it in your research paper.\n"          \
+           "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
+           SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
+           GAL_STRINGS_MAIN_BIBTEX, CONVOLVEBIBTEX);                    \
+    exit(EXIT_SUCCESS);                                                 \
 }
 
 #endif
diff --git a/src/convolve/convolve.c b/src/convolve/convolve.c
index e4b0f2e..d376861 100644
--- a/src/convolve/convolve.c
+++ b/src/convolve/convolve.c
@@ -551,9 +551,9 @@ twodimensionfft(struct convolveparams *p, struct 
fftonthreadparams *fp,
   else
     {
       /* Initialize the attributes. Note that this running thread
-        (that spinns off the nt threads) is also a thread, so the
-        number the barrier should be one more than the number of
-        threads spinned off. */
+         (that spinns off the nt threads) is also a thread, so the
+         number the barrier should be one more than the number of
+         threads spinned off. */
       if( multiple*p->ps0 < nt ) nb=multiple*p->ps0+1;
       else nb=nt+1;
       gal_threads_attr_barrier_init(&attr, &b, nb);
@@ -567,9 +567,9 @@ twodimensionfft(struct convolveparams *p, struct 
fftonthreadparams *fp,
             fp[i].stride=1; /* On each row, stride=1 */
             fp[i].indexs=&indexs[i*thrdcols];
             fp[i].forward1backwardn1=forward1backwardn1;
-           err=pthread_create(&t, &attr, onedimensionfft, &fp[i]);
-           if(err)
-             error(EXIT_FAILURE, 0, "can't create thread %lu for rows",
+            err=pthread_create(&t, &attr, onedimensionfft, &fp[i]);
+            if(err)
+              error(EXIT_FAILURE, 0, "can't create thread %lu for rows",
                     i);
           }
 
@@ -606,10 +606,10 @@ twodimensionfft(struct convolveparams *p, struct 
fftonthreadparams *fp,
             fp[i].stride=p->ps1; /* On each column, stride is p->ps1 */
             fp[i].indexs=&indexs[i*thrdcols];
             fp[i].forward1backwardn1=forward1backwardn1;
-           err=pthread_create(&t, &attr, onedimensionfft, &fp[i]);
-           if(err)
-             error(EXIT_FAILURE, 0, "can't create thread %lu for columns",
-                    i);
+            err=pthread_create(&t, &attr, onedimensionfft, &fp[i]);
+            if(err)
+              error(EXIT_FAILURE, 0,
+                    "can't create thread %lu for columns", i);
           }
       pthread_barrier_wait(&b);
       pthread_attr_destroy(&attr);
diff --git a/src/convolve/ui.c b/src/convolve/ui.c
index 0ac5c77..470cb99 100644
--- a/src/convolve/ui.c
+++ b/src/convolve/ui.c
@@ -29,10 +29,10 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <nproc.h>              /* From Gnulib.                   */
+#include <nproc.h>               /* From Gnulib.                   */
 
 #include <gnuastro/fits.h>
-#include <gnuastro/timing.h>   /* Includes time.h and sys/time.h */
+#include <gnuastro/timing.h>     /* Includes time.h and sys/time.h */
 #include <gnuastro/checkset.h>
 #include <gnuastro/statistics.h>
 #include <gnuastro/arraymanip.h>
@@ -40,8 +40,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* Needs main.h.                  */
-#include "args.h"              /* Needs main.h, includes argp.h. */
+#include "ui.h"                  /* Needs main.h.                  */
+#include "args.h"                /* Needs main.h, includes argp.h. */
 
 
 /* Set the file names of the places where the default parameters are
@@ -69,7 +69,7 @@ readconfig(char *filename, struct convolveparams *p)
   struct uiparams *up=&p->up;
   struct gal_commonparams *cp=&p->cp;
   int zeroorone, spatialset=0, frequencyset=0;
-  char key='a';        /* Not used, just a place holder. */
+  char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
      might be intentional, so there is no error. If a parameter is
@@ -86,7 +86,7 @@ readconfig(char *filename, struct convolveparams *p)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   /* Read the tokens in the file:  */
   while(getline(&line, &len, fp) != -1)
@@ -100,7 +100,8 @@ readconfig(char *filename, struct convolveparams *p)
       if(strcmp(name, "hdu")==0)
         gal_checkset_allocate_copy_set(value, &cp->hdu, &cp->hduset);
       else if (strcmp(name, "mask")==0)
-        gal_checkset_allocate_copy_set(value, &up->maskname, &up->masknameset);
+        gal_checkset_allocate_copy_set(value, &up->maskname,
+                                       &up->masknameset);
       else if (strcmp(name, "mhdu")==0)
         gal_checkset_allocate_copy_set(value, &up->mhdu, &up->mhduset);
       else if (strcmp(name, "kernel")==0)
@@ -113,104 +114,105 @@ readconfig(char *filename, struct convolveparams *p)
 
       /* Outputs: */
       else if(strcmp(name, "output")==0)
-        gal_checkset_allocate_copy_set(value, &cp->output, &cp->outputset);
+        gal_checkset_allocate_copy_set(value, &cp->output,
+                                       &cp->outputset);
 
 
 
 
       /* Mesh grid: */
       else if(strcmp(name, "meshsize")==0)
-       {
-         if(up->meshsizeset) continue;
-          gal_checkset_sizet_l_zero(value, &p->mp.meshsize, name, key, SPACK,
-                                    filename, lineno);
-         up->meshsizeset=1;
-       }
+        {
+          if(up->meshsizeset) continue;
+          gal_checkset_sizet_l_zero(value, &p->mp.meshsize, name, key,
+                                    SPACK, filename, lineno);
+          up->meshsizeset=1;
+        }
       else if(strcmp(name, "nch1")==0)
-       {
-         if(up->nch1set) continue;
+        {
+          if(up->nch1set) continue;
           gal_checkset_sizet_l_zero(value, &p->mp.nch1, name, key, SPACK,
                                     filename, lineno);
-         up->nch1set=1;
-       }
+          up->nch1set=1;
+        }
       else if(strcmp(name, "nch2")==0)
-       {
-         if(up->nch2set) continue;
+        {
+          if(up->nch2set) continue;
           gal_checkset_sizet_l_zero(value, &p->mp.nch2, name, key, SPACK,
                                     filename, lineno);
-         up->nch2set=1;
-       }
+          up->nch2set=1;
+        }
       else if(strcmp(name, "lastmeshfrac")==0)
-       {
-         if(up->lastmeshfracset) continue;
-          gal_checkset_float_l_0_s_1(value, &p->mp.lastmeshfrac, name, key, 
SPACK,
-                                     filename, lineno);
-         up->lastmeshfracset=1;
-       }
+        {
+          if(up->lastmeshfracset) continue;
+          gal_checkset_float_l_0_s_1(value, &p->mp.lastmeshfrac, name,
+                                     key, SPACK, filename, lineno);
+          up->lastmeshfracset=1;
+        }
       else if(strcmp(name, "fullconvolution")==0)
-       {
-         if(up->fullconvolutionset) continue;
+        {
+          if(up->fullconvolutionset) continue;
           gal_checkset_int_zero_or_one(value, &p->mp.fullconvolution, name,
                                        key, SPACK, filename, lineno);
-         up->fullconvolutionset=1;
-       }
+          up->fullconvolutionset=1;
+        }
 
 
 
       /* Operating modes: */
       else if(strcmp(name, "spatial")==0)
-       {
-         gal_checkset_int_zero_or_one(value, &zeroorone, name, key, SPACK,
-                                       filename, lineno);
-         if(zeroorone)
-           {
-             spatialset=1;
-             if(frequencyset)
-               error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                             "Spatial and frequency modes cannot be called "
-                             "together. It is ambiguous.");
-             if(up->spatialset==0)
-               {
-                 p->spatial=1;
-                 p->frequency=0;
-                 up->spatialset=up->frequencyset=1;
-               }
-           }
-       }
+        {
+          gal_checkset_int_zero_or_one(value, &zeroorone, name, key,
+                                       SPACK, filename, lineno);
+          if(zeroorone)
+            {
+              spatialset=1;
+              if(frequencyset)
+                error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                              "Spatial and frequency modes cannot be called "
+                              "together. It is ambiguous.");
+              if(up->spatialset==0)
+                {
+                  p->spatial=1;
+                  p->frequency=0;
+                  up->spatialset=up->frequencyset=1;
+                }
+            }
+        }
       else if(strcmp(name, "frequency")==0)
-       {
-         gal_checkset_int_zero_or_one(value, &zeroorone, name, key, SPACK,
-                                       filename, lineno);
-         if(zeroorone)
-           {
-             frequencyset=1;
-             if(spatialset)
-               error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                             "Spatial and frequency modes cannot be called "
-                             "together. It is ambiguous.");
-             if(up->frequencyset==0)
-               {
-                 p->spatial=0;
-                 p->frequency=1;
-                 up->spatialset=up->frequencyset=1;
-               }
-           }
-       }
+        {
+          gal_checkset_int_zero_or_one(value, &zeroorone, name, key,
+                                       SPACK, filename, lineno);
+          if(zeroorone)
+            {
+              frequencyset=1;
+              if(spatialset)
+                error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                              "Spatial and frequency modes cannot be "
+                              "called together. It is ambiguous.");
+              if(up->frequencyset==0)
+                {
+                  p->spatial=0;
+                  p->frequency=1;
+                  up->spatialset=up->frequencyset=1;
+                }
+            }
+        }
       else if(strcmp(name, "makekernel")==0)
-       {
-         if(up->makekernelset) continue;
-          gal_checkset_int_el_zero(value, &p->makekernel, name, key, SPACK,
-                                   filename, lineno);
-         up->makekernelset=1;
-       }
+        {
+          if(up->makekernelset) continue;
+          gal_checkset_int_el_zero(value, &p->makekernel, name, key,
+                                   SPACK, filename, lineno);
+          up->makekernelset=1;
+        }
 
       /* Read options common to all programs */
       GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF
 
 
       else
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     "`%s` not recognized.\n", name);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      "`%s` not recognized.\n", name);
     }
 
   free(line);
diff --git a/src/cosmiccal/args.h b/src/cosmiccal/args.h
index 0e927af..ad926b1 100644
--- a/src/cosmiccal/args.h
+++ b/src/cosmiccal/args.h
@@ -184,9 +184,9 @@ parse_opt(int key, char *arg, struct argp_state *state)
      user is warned and the program is stopped: */
   if(arg && arg[0]=='=')
     argp_error(state, "incorrect use of the equal sign (`=`). For short "
-              "options, `=` should not be used and for long options, "
-              "there should be no space between the option, equal sign "
-              "and value");
+               "options, `=` should not be used and for long options, "
+               "there should be no space between the option, equal sign "
+               "and value");
 
   switch(key)
     {
@@ -249,13 +249,13 @@ parse_opt(int key, char *arg, struct argp_state *state)
          no need for such checks.
 
       if(p->cp.setdirconf==0 && p->cp.setusrconf==0
-        && p->cp.printparams==0)
-       {
-         if(state->arg_num==0)
-           argp_error(state, "no argument given");
-         if(p->up.inputname==NULL)
-           argp_error(state, "no input FITS image(s) provided");
-       }
+         && p->cp.printparams==0)
+        {
+          if(state->arg_num==0)
+            argp_error(state, "no argument given");
+          if(p->up.inputname==NULL)
+            argp_error(state, "no input FITS image(s) provided");
+        }
       */
         break;
 
@@ -286,6 +286,6 @@ struct argp_child children[]=
 
 /* Basic structure defining the whole argument reading process. */
 static struct argp thisargp = {options, parse_opt, args_doc,
-                              doc, children, NULL, NULL};
+                               doc, children, NULL, NULL};
 
 #endif
diff --git a/src/cosmiccal/cite.h b/src/cosmiccal/cite.h
index d6d54b9..bab546e 100644
--- a/src/cosmiccal/cite.h
+++ b/src/cosmiccal/cite.h
@@ -25,14 +25,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #define COSMICCALBIBTEX ""
 
-#define PRINTCITEABORT {                                               \
-    printf("\nWe hope %s has been useful for your research.\n"         \
-          "Citations are vital for the continued work on %s.\n"        \
-          "Thank you for citing it in your research paper.\n"          \
-          "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
-          SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
-           GAL_STRINGS_MAIN_BIBTEX, COSMICCALBIBTEX);                  \
-    exit(EXIT_SUCCESS);                                                        
\
+#define PRINTCITEABORT {                                                \
+    printf("\nWe hope %s has been useful for your research.\n"          \
+           "Citations are vital for the continued work on %s.\n"        \
+           "Thank you for citing it in your research paper.\n"          \
+           "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
+           SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
+           GAL_STRINGS_MAIN_BIBTEX, COSMICCALBIBTEX);                   \
+    exit(EXIT_SUCCESS);                                                 \
 }
 
 #endif
diff --git a/src/cosmiccal/main.c b/src/cosmiccal/main.c
index 2f43671..00b9770 100644
--- a/src/cosmiccal/main.c
+++ b/src/cosmiccal/main.c
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* needs main.h.                  */
+#include "ui.h"                 /* needs main.h.                  */
 #include "cosmiccal.h"          /* needs main.h.                  */
 
 int
diff --git a/src/cosmiccal/ui.c b/src/cosmiccal/ui.c
index 94dd0f4..bdcf002 100644
--- a/src/cosmiccal/ui.c
+++ b/src/cosmiccal/ui.c
@@ -30,11 +30,11 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <string.h>
 #include <fitsio.h>
 
-#include <nproc.h>              /* From Gnulib.                     */
+#include <nproc.h>               /* From Gnulib.                   */
 #include <gsl/gsl_const_mksa.h>
 
 #include <gnuastro/fits.h>
-#include <gnuastro/timing.h>    /* Includes time.h and sys/time.h   */
+#include <gnuastro/timing.h>     /* Includes time.h and sys/time.h */
 #include <gnuastro/checkset.h>
 #include <gnuastro/txtarray.h>
 #include <gnuastro/commonargs.h>
@@ -42,8 +42,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* Needs main.h                   */
-#include "args.h"              /* Needs main.h, includes argp.h. */
+#include "ui.h"                  /* Needs main.h                   */
+#include "args.h"                /* Needs main.h, includes argp.h. */
 
 
 /* Set the file names of the places where the default parameters are
@@ -73,7 +73,7 @@ readconfig(char *filename, struct cosmiccalparams *p)
   char *line, *name, *value;
   struct uiparams *up=&p->up;
   struct gal_commonparams *cp=&p->cp;
-  char key='a';        /* Not used, just a place holder. */
+  char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
      might be intentional, so there is no error. If a parameter is
@@ -90,7 +90,7 @@ readconfig(char *filename, struct cosmiccalparams *p)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   /* Read the tokens in the file:  */
   while(getline(&line, &len, fp) != -1)
@@ -103,58 +103,58 @@ readconfig(char *filename, struct cosmiccalparams *p)
 
       /* Inputs: */
       if(strcmp(name, "redshift")==0)
-       {
-         if(up->redshiftset) continue;
+        {
+          if(up->redshiftset) continue;
           gal_checkset_double_el_0(value, &p->redshift, name, key,
                                       SPACK, filename, lineno);
-         up->redshiftset=1;
-       }
+          up->redshiftset=1;
+        }
       else if(strcmp(name, "H0")==0)
-       {
-         if(up->H0set) continue;
+        {
+          if(up->H0set) continue;
           gal_checkset_double_el_0(value, &p->H0, name, key, SPACK,
                                       filename, lineno);
-         up->H0set=1;
-       }
+          up->H0set=1;
+        }
       else if(strcmp(name, "olambda")==0)
-       {
-         if(up->olambdaset) continue;
+        {
+          if(up->olambdaset) continue;
           gal_checkset_double_el_0(value, &p->olambda, name, key,
                                       SPACK, filename, lineno);
-         up->olambdaset=1;
-       }
+          up->olambdaset=1;
+        }
       else if(strcmp(name, "omatter")==0)
-       {
-         if(up->omatterset) continue;
+        {
+          if(up->omatterset) continue;
           gal_checkset_double_el_0(value, &p->omatter, name, key,
                                       SPACK, filename, lineno);
-         up->omatterset=1;
-       }
+          up->omatterset=1;
+        }
       else if(strcmp(name, "oradiation")==0)
-       {
-         if(up->oradiationset) continue;
+        {
+          if(up->oradiationset) continue;
           gal_checkset_double_el_0(value, &p->oradiation, name, key,
                                    SPACK, filename, lineno);
-         up->oradiationset=1;
-       }
+          up->oradiationset=1;
+        }
 
 
 
       /* Outputs */
       else if(strcmp(name, "onlyvolume")==0)
-       {
-         if(up->onlyvolumeset) continue;
+        {
+          if(up->onlyvolumeset) continue;
           gal_checkset_int_zero_or_one(value, &p->onlyvolume, name, key,
                                        SPACK, filename, lineno);
-         up->onlyvolumeset=1;
-       }
+          up->onlyvolumeset=1;
+        }
       else if(strcmp(name, "onlyabsmagconv")==0)
-       {
-         if(up->onlyabsmagconvset) continue;
+        {
+          if(up->onlyabsmagconvset) continue;
           gal_checkset_int_zero_or_one(value, &p->onlyabsmagconv, name,
                                        key, SPACK, filename, lineno);
-         up->onlyabsmagconvset=1;
-       }
+          up->onlyabsmagconvset=1;
+        }
 
 
 
@@ -164,8 +164,8 @@ readconfig(char *filename, struct cosmiccalparams *p)
 
 
       else
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     "`%s` not recognized.\n", name);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      "`%s` not recognized.\n", name);
     }
 
   free(line);
diff --git a/src/header/args.h b/src/header/args.h
index 8402d46..acd0b35 100644
--- a/src/header/args.h
+++ b/src/header/args.h
@@ -204,9 +204,9 @@ parse_opt(int key, char *arg, struct argp_state *state)
      user is warned and the program is stopped: */
   if(arg && arg[0]=='=')
     argp_error(state, "incorrect use of the equal sign (`=`). For short "
-              "options, `=` should not be used and for long options, "
-              "there should be no space between the option, equal sign "
-              "and value");
+               "options, `=` should not be used and for long options, "
+               "there should be no space between the option, equal sign "
+               "and value");
 
   switch(key)
     {
@@ -257,7 +257,7 @@ parse_opt(int key, char *arg, struct argp_state *state)
             argp_error(state, "only one input image should be given");
           else
             p->up.inputname=arg;
-       }
+        }
       else
         argp_error(state, "%s is not a valid file type", arg);
       break;
@@ -269,13 +269,13 @@ parse_opt(int key, char *arg, struct argp_state *state)
     /* The command line options and arguments are finished. */
     case ARGP_KEY_END:
       if(p->cp.setdirconf==0 && p->cp.setusrconf==0
-        && p->cp.printparams==0)
-       {
-         if(state->arg_num==0)
-           argp_error(state, "no argument given");
-         if(p->up.inputname==NULL)
-           argp_error(state, "no input FITS image(s) provided");
-       }
+         && p->cp.printparams==0)
+        {
+          if(state->arg_num==0)
+            argp_error(state, "no argument given");
+          if(p->up.inputname==NULL)
+            argp_error(state, "no input FITS image(s) provided");
+        }
       break;
 
 
@@ -305,6 +305,6 @@ struct argp_child children[]=
 
 /* Basic structure defining the whole argument reading process. */
 static struct argp thisargp = {options, parse_opt, args_doc,
-                              doc, children, NULL, NULL};
+                               doc, children, NULL, NULL};
 
 #endif
diff --git a/src/header/cite.h b/src/header/cite.h
index f6c2b0c..dcf0fd9 100644
--- a/src/header/cite.h
+++ b/src/header/cite.h
@@ -25,14 +25,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #define HEADERBIBTEX ""
 
-#define PRINTCITEABORT {                                               \
-    printf("\nWe hope %s has been useful for your research.\n"         \
-          "Citations are vital for the continued work on %s.\n"        \
-          "Thank you for citing it in your research paper.\n"          \
-          "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
-          SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
-           GAL_STRINGS_MAIN_BIBTEX, HEADERBIBTEX);                     \
-    exit(EXIT_SUCCESS);                                                        
\
-}
+#define PRINTCITEABORT {                                                \
+    printf("\nWe hope %s has been useful for your research.\n"          \
+           "Citations are vital for the continued work on %s.\n"        \
+           "Thank you for citing it in your research paper.\n"          \
+           "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
+           SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
+           GAL_STRINGS_MAIN_BIBTEX, HEADERBIBTEX);                      \
+    exit(EXIT_SUCCESS);                                                 \
+  }
 
 #endif
diff --git a/src/header/header.c b/src/header/header.c
index 8cce5ea..56ff673 100644
--- a/src/header/header.c
+++ b/src/header/header.c
@@ -139,7 +139,7 @@ writeupdatekeys(fitsfile *fptr, struct gal_fits_header_ll 
**keylist,
       if(tmp->cfree) free(tmp->comment);
 
       /* Keep the pointer to the next keyword and free the allocated
-        space for this keyword.*/
+         space for this keyword.*/
       ttmp=tmp->next;
       free(tmp);
       tmp=ttmp;
diff --git a/src/header/main.c b/src/header/main.c
index 70b7c8b..87984cf 100644
--- a/src/header/main.c
+++ b/src/header/main.c
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* needs main.h.                  */
+#include "ui.h"                 /* needs main.h.                  */
 #include "header.h"             /* needs main.h.                  */
 
 int
diff --git a/src/header/ui.c b/src/header/ui.c
index 67ccf73..19f1719 100644
--- a/src/header/ui.c
+++ b/src/header/ui.c
@@ -30,10 +30,10 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <string.h>
 #include <fitsio.h>
 
-#include <nproc.h>              /* From Gnulib.                     */
+#include <nproc.h>               /* From Gnulib.                   */
 
 #include <gnuastro/fits.h>
-#include <gnuastro/timing.h>    /* Includes time.h and sys/time.h   */
+#include <gnuastro/timing.h>     /* Includes time.h and sys/time.h */
 #include <gnuastro/checkset.h>
 #include <gnuastro/txtarray.h>
 #include <gnuastro/commonargs.h>
@@ -41,8 +41,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* Needs main.h                   */
-#include "args.h"              /* Needs main.h, includes argp.h. */
+#include "ui.h"                  /* Needs main.h                   */
+#include "args.h"                /* Needs main.h, includes argp.h. */
 
 
 /* Set the file names of the places where the default parameters are
@@ -72,7 +72,7 @@ readconfig(char *filename, struct headerparams *p)
   char *line, *name, *value;
   /*struct uiparams *up=&p->up;*/
   struct gal_commonparams *cp=&p->cp;
-  char key='a';        /* Not used, just a place holder. */
+  char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
      might be intentional, so there is no error. If a parameter is
@@ -89,7 +89,7 @@ readconfig(char *filename, struct headerparams *p)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   /* Read the tokens in the file:  */
   while(getline(&line, &len, fp) != -1)
@@ -102,15 +102,15 @@ readconfig(char *filename, struct headerparams *p)
 
       /* Inputs: */
       if(strcmp(name, "hdu")==0)
-       {
-         if(cp->hduset) continue;
-         errno=0;
-         cp->hdu=malloc(strlen(value)+1);
-         if(cp->hdu==NULL)
-           error(EXIT_FAILURE, errno, "space for HDU");
-         strcpy(cp->hdu, value);
-         cp->hduset=1;
-       }
+        {
+          if(cp->hduset) continue;
+          errno=0;
+          cp->hdu=malloc(strlen(value)+1);
+          if(cp->hdu==NULL)
+            error(EXIT_FAILURE, errno, "space for HDU");
+          strcpy(cp->hdu, value);
+          cp->hduset=1;
+        }
 
 
 
@@ -125,8 +125,8 @@ readconfig(char *filename, struct headerparams *p)
 
 
       else
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     "`%s` not recognized.\n", name);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      "`%s` not recognized.\n", name);
     }
 
   free(line);
@@ -325,9 +325,9 @@ fillfitsheaderll(struct gal_linkedlist_stll *input,
                     unit=start;
                     break;
                   default:
-                    error(EXIT_FAILURE, 0, "%s: only three commas should be "
-                          "given in the write or update keyword options. "
-                          "The general expected format is:\n"
+                    error(EXIT_FAILURE, 0, "%s: only three commas should "
+                          "be given in the write or update keyword "
+                          "options. The general expected format is:\n"
                           "    KEYWORD,value,\"a comment string\",unit\n",
                           original);
                   }
@@ -385,7 +385,7 @@ fillfitsheaderll(struct gal_linkedlist_stll *input,
 
 
       gal_fits_add_to_fits_header_ll(output, datatype, keyname, 0,
-                                          fvalue, vfree, comment, 0, unit);
+                                     fvalue, vfree, comment, 0, unit);
       free(original);
     }
 }
diff --git a/src/imgcrop/args.h b/src/imgcrop/args.h
index b468569..0a6ea9f 100644
--- a/src/imgcrop/args.h
+++ b/src/imgcrop/args.h
@@ -327,9 +327,9 @@ parse_opt(int key, char *arg, struct argp_state *state)
      user is warned and the program is stopped: */
   if(arg && arg[0]=='=')
     argp_error(state, "incorrect use of the equal sign (`=`). For short "
-              "options, `=` should not be used and for long options, "
-              "there should be no space between the option, equal sign "
-              "and value");
+               "options, `=` should not be used and for long options, "
+               "there should be no space between the option, equal sign "
+               "and value");
 
   switch(key)
     {
@@ -337,14 +337,14 @@ parse_opt(int key, char *arg, struct argp_state *state)
     /* Operating modes: */
     case 'I':
       if(p->up.imgmodeset)
-       argp_error(state, "only one of Image or WCS modes can be chosen");
+        argp_error(state, "only one of Image or WCS modes can be chosen");
       p->imgmode=1;
       p->wcsmode=0;
       p->up.imgmodeset=p->up.wcsmodeset=1;
       break;
     case 'W':
       if(p->up.wcsmodeset)
-       argp_error(state, "only one of Image or WCS modes can be chosen");
+        argp_error(state, "only one of Image or WCS modes can be chosen");
       p->imgmode=0;
       p->wcsmode=1;
       p->up.imgmodeset=p->up.wcsmodeset=1;
@@ -378,8 +378,8 @@ parse_opt(int key, char *arg, struct argp_state *state)
       p->keepblankcenter=1;
       break;
     case 'c':
-      gal_checkset_sizet_l_zero(arg, &p->checkcenter, "checkcenter", key, 
SPACK,
-                                NULL, 0);
+      gal_checkset_sizet_l_zero(arg, &p->checkcenter, "checkcenter",
+                                key, SPACK, NULL, 0);
       p->up.checkcenterset=1;
       break;
     case 'p':
@@ -419,11 +419,11 @@ parse_opt(int key, char *arg, struct argp_state *state)
       break;
     case 'x':
       gal_checkset_any_double(arg, &p->xc, "xc", key, SPACK, NULL, 0);
-      p->up.xcset=1;           /* Using FITS standard, not C. */
+      p->up.xcset=1;            /* Using FITS standard, not C. */
       break;
     case 'y':
       gal_checkset_any_double(arg, &p->yc, "yc", key, SPACK, NULL, 0);
-      p->up.ycset=1;           /* Using FITS standard, not C. */
+      p->up.ycset=1;            /* Using FITS standard, not C. */
       break;
     case 'a':
       gal_checkset_sizet_l_zero(arg, &tmp, "iwidth", key, SPACK, NULL, 0);
@@ -431,7 +431,8 @@ parse_opt(int key, char *arg, struct argp_state *state)
       p->up.iwidthset=1;
       break;
     case 'w':
-      gal_checkset_double_l_0(arg, &p->wwidth, "wwidth", key, SPACK, NULL, 0);
+      gal_checkset_double_l_0(arg, &p->wwidth, "wwidth", key, SPACK,
+                              NULL, 0);
       p->up.wwidthset=1;
       break;
     case 's':
@@ -459,20 +460,20 @@ parse_opt(int key, char *arg, struct argp_state *state)
 
       /* See what type of input value it is and put it in. */
       if( gal_fits_name_is_fits(arg) )
-       {
-         gal_linkedlist_add_to_stll(&p->up.gal_linkedlist_stll, arg);
-         ++p->numimg;
-       }
+        {
+          gal_linkedlist_add_to_stll(&p->up.gal_linkedlist_stll, arg);
+          ++p->numimg;
+        }
       else
-       {
-         if(p->up.catname)
-           argp_error(state, "only one catalog file can be given");
-         else
-           {
-             p->up.catname=arg;
-             p->up.catset=1;
-           }
-       }
+        {
+          if(p->up.catname)
+            argp_error(state, "only one catalog file can be given");
+          else
+            {
+              p->up.catname=arg;
+              p->up.catset=1;
+            }
+        }
       break;
 
 
@@ -482,18 +483,18 @@ parse_opt(int key, char *arg, struct argp_state *state)
     /* The command line options and arguments are finished. */
     case ARGP_KEY_END:
       if(p->cp.setdirconf==0 && p->cp.setusrconf==0
-        && p->cp.printparams==0)
-       {
-         if(state->arg_num==0)
-           argp_error(state, "no argument given");
-         if(p->up.catname==NULL && !(p->up.xcset    || p->up.ycset
-                                     || p->up.raset || p->up.decset
-                                     || p->up.sectionset
+         && p->cp.printparams==0)
+        {
+          if(state->arg_num==0)
+            argp_error(state, "no argument given");
+          if(p->up.catname==NULL && !(p->up.xcset    || p->up.ycset
+                                      || p->up.raset || p->up.decset
+                                      || p->up.sectionset
                                       || p->up.polygonset))
-           argp_error(state, "no catalog provided");
-         if(p->up.gal_linkedlist_stll==NULL)
-           argp_error(state, "no FITS image(s) provided");
-       }
+            argp_error(state, "no catalog provided");
+          if(p->up.gal_linkedlist_stll==NULL)
+            argp_error(state, "no FITS image(s) provided");
+        }
       break;
 
 
@@ -523,6 +524,6 @@ struct argp_child children[]=
 
 /* Basic structure defining the whole argument reading process. */
 static struct argp thisargp = {options, parse_opt, args_doc,
-                              doc, children, NULL, NULL};
+                               doc, children, NULL, NULL};
 
 #endif
diff --git a/src/imgcrop/cite.h b/src/imgcrop/cite.h
index 580c64b..9987c8b 100644
--- a/src/imgcrop/cite.h
+++ b/src/imgcrop/cite.h
@@ -25,14 +25,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #define IMGCROPBIBTEX ""
 
-#define PRINTCITEABORT {                                               \
-    printf("\nWe hope %s has been useful for your research.\n"         \
-          "Citations are vital for the continued work on %s.\n"        \
-          "Thank you for citing it in your research paper.\n"          \
-          "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
-          SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
-           GAL_STRINGS_MAIN_BIBTEX, IMGCROPBIBTEX);                    \
-    exit(EXIT_SUCCESS);                                                        
\
+#define PRINTCITEABORT {                                                \
+    printf("\nWe hope %s has been useful for your research.\n"          \
+           "Citations are vital for the continued work on %s.\n"        \
+           "Thank you for citing it in your research paper.\n"          \
+           "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
+           SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
+           GAL_STRINGS_MAIN_BIBTEX, IMGCROPBIBTEX);                     \
+    exit(EXIT_SUCCESS);                                                 \
 }
 
 #endif
diff --git a/src/imgcrop/crop.c b/src/imgcrop/crop.c
index 31b0a7f..2d234fd 100644
--- a/src/imgcrop/crop.c
+++ b/src/imgcrop/crop.c
@@ -89,32 +89,32 @@ sectionparser(char *section, long *naxes, long *fpixel, 
long *lpixel)
     {
       add=0;
       switch(*pt)
-       {
-       case ',':
-         ++dim;
-         if(dim==2)
-           error(EXIT_FAILURE, 0, "Extra `,` in `%s`", section);
-         forl='f';
-         ++pt;
-         break;
-       case ':':
-         forl='l';
-         ++pt;
-         break;
-       case '.':
-         error(EXIT_FAILURE, 0, "the numbers in the argument to "
-               "`--section` (`-s') have to be integers. You input "
-               "includes a float number: %s",
-               section);
-         break;
-       case ' ': case '\t':
-         ++pt;
-         break;
+        {
+        case ',':
+          ++dim;
+          if(dim==2)
+            error(EXIT_FAILURE, 0, "Extra `,` in `%s`", section);
+          forl='f';
+          ++pt;
+          break;
+        case ':':
+          forl='l';
+          ++pt;
+          break;
+        case '.':
+          error(EXIT_FAILURE, 0, "the numbers in the argument to "
+                "`--section` (`-s') have to be integers. You input "
+                "includes a float number: %s",
+                section);
+          break;
+        case ' ': case '\t':
+          ++pt;
+          break;
         case '*':
           add=1;                /* If it is an asterisk, then add the */
           ++pt;                 /* given value to the maximum size of */
           break;                /* the image. */
-       default:
+        default:
           break;
         }
 
@@ -126,7 +126,7 @@ sectionparser(char *section, long *naxes, long *fpixel, 
long *lpixel)
       */
 
       /* Make sure if a number was read at all? */
-      if(tailptr==pt)          /* No number was read!             */
+      if(tailptr==pt)                /* No number was read!             */
         {
           if(add) read=0;       /* We have a * followed by `:' or `,'. */
           else    continue;
@@ -152,14 +152,14 @@ sectionparser(char *section, long *naxes, long *fpixel, 
long *lpixel)
 
   if(fpixel[0]>=lpixel[0] || fpixel[1]>=lpixel[1])
     error(EXIT_FAILURE, 0, "the bottom left corner coordinates "
-         "cannot be larger or equal to the top right's! Your section "
-         "string (%s) has been read as: bottom left coordinate "
-         "(%ld, %ld) to top right coordinate (%ld, %ld)",
-         section, fpixel[0], fpixel[1], lpixel[0], lpixel[1]);
+          "cannot be larger or equal to the top right's! Your section "
+          "string (%s) has been read as: bottom left coordinate "
+          "(%ld, %ld) to top right coordinate (%ld, %ld)",
+          section, fpixel[0], fpixel[1], lpixel[0], lpixel[1]);
 
   /*
   printf("\n%s\nfpixel=(%ld, %ld), lpixel=(%ld, %ld)\n\n", section,
-        fpixel[0], fpixel[1], lpixel[0], lpixel[1]);
+         fpixel[0], fpixel[1], lpixel[0], lpixel[1]);
   exit(0);
   */
 }
@@ -182,21 +182,21 @@ polygonparser(struct imgcropparams *p)
   while(*pt!='\0')
     {
       switch(*pt)
-       {
-       case ',':
-         ++dim;
-         if(dim==2)
-           error(EXIT_FAILURE, 0, "Extra `,` in `%s`", p->up.polygon);
-         ++pt;
-         break;
-       case ':':
+        {
+        case ',':
+          ++dim;
+          if(dim==2)
+            error(EXIT_FAILURE, 0, "Extra `,` in `%s`", p->up.polygon);
+          ++pt;
+          break;
+        case ':':
           if(dim==0)
             error(EXIT_FAILURE, 0, "not enough coordinates for at least "
                   "one polygon vertex (in %s)", p->up.polygon);
           dim=0;
-         ++pt;
-         break;
-       default:
+          ++pt;
+          break;
+        default:
           break;
         }
 
@@ -217,14 +217,15 @@ polygonparser(struct imgcropparams *p)
           */
 
           /* Make sure if a number was read at all? */
-          if(tailptr==pt)              /* No number was read!             */
+          if(tailptr==pt) /* No number was read! */
             error(EXIT_FAILURE, 0, "%s could not be parsed as a floating "
                   "point number", tailptr);
 
           /* If this was the second dimension, then put the values
              into the linked list: */
           if(dim==1)
-            gal_linkedlist_add_to_tdll(&gal_linkedlist_tdll, read[0], read[1]);
+            gal_linkedlist_add_to_tdll(&gal_linkedlist_tdll, read[0],
+                                       read[1]);
 
           /* The job here is done, start from tailptr */
           pt=tailptr;
@@ -232,7 +233,8 @@ polygonparser(struct imgcropparams *p)
     }
 
   /* Convert the linked list to an array: */
-  gal_linkedlist_tdll_to_array_inv(gal_linkedlist_tdll, &array, &p->nvertices);
+  gal_linkedlist_tdll_to_array_inv(gal_linkedlist_tdll, &array,
+                                   &p->nvertices);
   if(p->imgmode) { p->ipolygon=array; p->wpolygon=NULL;  }
   else           { p->ipolygon=NULL;  p->wpolygon=array; }
 
@@ -330,7 +332,8 @@ polygonmask(struct cropparams *crp, void *array, long 
*fpixel_i,
       for(i=0;i<size;++i)
         {
           point[0]=i%s1+1; point[1]=i/s1+1;
-          if(gal_polygon_pin(ipolygon, point, nvertices)==outpolygon) 
ba[i]=*bb;
+          if(gal_polygon_pin(ipolygon, point, nvertices)==outpolygon)
+            ba[i]=*bb;
         }
       free(bb);
       break;
@@ -339,7 +342,8 @@ polygonmask(struct cropparams *crp, void *array, long 
*fpixel_i,
       for(i=0;i<size;++i)
         {
           point[0]=i%s1+1; point[1]=i/s1+1;
-          if(gal_polygon_pin(ipolygon, point, nvertices)==outpolygon) 
sa[i]=*sb;
+          if(gal_polygon_pin(ipolygon, point, nvertices)==outpolygon)
+            sa[i]=*sb;
         }
       free(sb);
       break;
@@ -348,7 +352,8 @@ polygonmask(struct cropparams *crp, void *array, long 
*fpixel_i,
       for(i=0;i<size;++i)
         {
           point[0]=i%s1+1; point[1]=i/s1+1;
-          if(gal_polygon_pin(ipolygon, point, nvertices)==outpolygon) 
la[i]=*lb;
+          if(gal_polygon_pin(ipolygon, point, nvertices)==outpolygon)
+            la[i]=*lb;
         }
       free(lb);
       break;
@@ -357,7 +362,8 @@ polygonmask(struct cropparams *crp, void *array, long 
*fpixel_i,
       for(i=0;i<size;++i)
         {
           point[0]=i%s1+1; point[1]=i/s1+1;
-          if(gal_polygon_pin(ipolygon, point, nvertices)==outpolygon) 
La[i]=*Lb;
+          if(gal_polygon_pin(ipolygon, point, nvertices)==outpolygon)
+            La[i]=*Lb;
         }
       free(Lb);
       break;
@@ -366,7 +372,8 @@ polygonmask(struct cropparams *crp, void *array, long 
*fpixel_i,
       for(i=0;i<size;++i)
         {
           point[0]=i%s1+1; point[1]=i/s1+1;
-          if(gal_polygon_pin(ipolygon, point, nvertices)==outpolygon) 
fa[i]=*fb;
+          if(gal_polygon_pin(ipolygon, point, nvertices)==outpolygon)
+            fa[i]=*fb;
         }
       free(fb);
       break;
@@ -375,7 +382,8 @@ polygonmask(struct cropparams *crp, void *array, long 
*fpixel_i,
       for(i=0;i<size;++i)
         {
           point[0]=i%s1+1; point[1]=i/s1+1;
-          if(gal_polygon_pin(ipolygon, point, nvertices)==outpolygon) 
da[i]=*db;
+          if(gal_polygon_pin(ipolygon, point, nvertices)==outpolygon)
+            da[i]=*db;
         }
       free(db);
       break;
@@ -423,21 +431,22 @@ changezerotonan(void *array, size_t size, int bitpix)
     case FLOAT_IMG:
       ffp=(fp=array)+size;
       do
-       if(*fp==0.0f) *fp=NAN;
+        if(*fp==0.0f) *fp=NAN;
       while(++fp<ffp);
       break;
 
     case DOUBLE_IMG:
       fdp=(dp=array)+size;
       do
-       if(*dp==0.0f) *dp=NAN;
+        if(*dp==0.0f) *dp=NAN;
       while(++dp<fdp);
       break;
 
     default:
       error(EXIT_FAILURE, 0, "in changezerotonan, bitpix is not "
-           "recognized! This is out of the users control and is a bug, "
-           "please report it to us so we see how it was caused and fix it");
+            "recognized! This is out of the users control and is a bug, "
+            "please report it to us so we see how it was caused and fix "
+            "it");
     }
 }
 
@@ -460,24 +469,24 @@ cropname(struct cropparams *crp)
       errno=0;
       log->name=malloc(crp->outlen);
       if(log->name==NULL)
-       error(EXIT_FAILURE, errno, "imgmode.c, %lu bytes on "
-             "imgcroponthreads", crp->outlen);
+        error(EXIT_FAILURE, errno, "imgmode.c, %lu bytes on "
+              "imgcroponthreads", crp->outlen);
       sprintf(log->name, "%s%lu%s", cp->output, crp->outindex+1,
-             p->suffix);
+              p->suffix);
       gal_checkset_check_remove_file(log->name, cp->dontdelete);
     }
   else
     {
       /* Set the output name. */
       if(p->outnameisfile)            /* An output file was specified. */
-       {
-         log->name=cp->output;
-         gal_checkset_check_remove_file(log->name, cp->dontdelete);
-       }
-      else       /* The output was a directory, use automatic output. */
-       gal_checkset_automatic_output(p->imgs[crp->imgindex].name, p->suffix,
-                       cp->removedirinfo, cp->dontdelete,
-                       &log->name);
+        {
+          log->name=cp->output;
+          gal_checkset_check_remove_file(log->name, cp->dontdelete);
+        }
+      else          /* The output was a directory, use automatic output. */
+        gal_checkset_automatic_output(p->imgs[crp->imgindex].name,
+                                      p->suffix, cp->removedirinfo,
+                                      cp->dontdelete, &log->name);
     }
 }
 
@@ -505,22 +514,22 @@ cropflpixel(struct cropparams *crp)
       else if(p->up.xcset)
         gal_box_border_from_center(p->xc, p->yc, p->iwidth, fpixel, lpixel);
       else if(p->up.sectionset)
-       sectionparser(p->section, naxes, fpixel, lpixel);
+        sectionparser(p->section, naxes, fpixel, lpixel);
       else if(p->up.polygonset)
         {
           if(p->outpolygon==0)
             imgpolygonflpixel(p->ipolygon, p->nvertices, fpixel, lpixel);
         }
       else
-       error(EXIT_FAILURE, 0, "a bug! In image mode, neither of the "
-             "following has been set: a catalog, a central pixel, "
-             "a section or a polygon in the image. Please contact us "
+        error(EXIT_FAILURE, 0, "a bug! In image mode, neither of the "
+              "following has been set: a catalog, a central pixel, "
+              "a section or a polygon in the image. Please contact us "
               "to see how it got to this impossible place! You should "
               "have been warned of this condition long before ImageCrop "
               "reaches this point");
     }
   else if(p->wcsmode) /* In wcsmode, crp->world is already filled.       */
-    {                /* Note that p->iwidth was set based on p->wwidth. */
+    {                 /* Note that p->iwidth was set based on p->wwidth. */
       if(p->up.polygonset)
         { /* Fill crp->ipolygon in wcspolygonpixel, then set flpixel*/
           fillcrpipolygon(crp);
@@ -544,8 +553,8 @@ cropflpixel(struct cropparams *crp)
     }
   else
     error(EXIT_FAILURE, 0, "a bug! in cropflpixel (crop.c), "
-         "neither imgmode or wcsmode are set. Please contact us so "
-         "we can see how it got to this impossible place");
+          "neither imgmode or wcsmode are set. Please contact us so "
+          "we can see how it got to this impossible place");
 
   /* If the user only wants regions outside to the polygon, then set
      the fpixel and lpixel to cover the full input image. */
@@ -573,7 +582,7 @@ cropflpixel(struct cropparams *crp)
 */
 void
 firstcropmakearray(struct cropparams *crp, long *fpixel_i,
-                  long *lpixel_i, long *fpixel_c, long *lpixel_c)
+                   long *lpixel_i, long *fpixel_c, long *lpixel_c)
 {
   size_t i;
   fitsfile *ofp;
@@ -618,7 +627,7 @@ firstcropmakearray(struct cropparams *crp, long *fpixel_i,
   if(bitpix==BYTE_IMG || bitpix==SHORT_IMG
      || bitpix==LONG_IMG || bitpix==LONGLONG_IMG)
     if(fits_write_key(ofp, crp->p->datatype, "BLANK",
-                     crp->p->bitnul, "pixels with no data", &status) )
+                      crp->p->bitnul, "pixels with no data", &status) )
       gal_fits_io_error(status, "adding Blank");
   if(fits_write_null_img(ofp, 1, naxes[0]*naxes[1], &status))
     gal_fits_io_error(status, "writing null array");
@@ -694,29 +703,29 @@ onecrop(struct cropparams *crp)
   if( gal_box_overlap(img->naxes, fpixel_i, lpixel_i, fpixel_o, lpixel_o) )
     {
       /* Make the output FITS image and initialize it with an array of
-        NaN or BLANK values. Note that for FLOAT_IMG and DOUBLE_IMG,
-        it will automatically fill them with the NaN value.*/
+         NaN or BLANK values. Note that for FLOAT_IMG and DOUBLE_IMG,
+         it will automatically fill them with the NaN value.*/
       if(crp->outfits==NULL)
-       firstcropmakearray(crp, fpixel_i, lpixel_i, fpixel_o, lpixel_o);
+        firstcropmakearray(crp, fpixel_i, lpixel_i, fpixel_o, lpixel_o);
       ofp=crp->outfits;
 
 
       /* Read the desired part of the image, then write it into this
-        array. */
+         array. */
       cropsize=(lpixel_i[0]-fpixel_i[0]+1)*(lpixel_i[1]-fpixel_i[1]+1);
       array=gal_fits_bitpix_alloc(cropsize, bitpix);
       status=0;
       if(fits_read_subset(ifp, p->datatype, fpixel_i, lpixel_i, inc,
-                         p->bitnul, array, &anynul, &status))
-       gal_fits_io_error(status, NULL);
+                          p->bitnul, array, &anynul, &status))
+        gal_fits_io_error(status, NULL);
 
 
       /* If we have a floating point or double image, pixels with zero
-        value should actually be a NaN. Unless the user specificly
-        asks for it, make the conversion.*/
+         value should actually be a NaN. Unless the user specificly
+         asks for it, make the conversion.*/
       if(p->zeroisnotblank==0
-        && (bitpix==FLOAT_IMG || bitpix==DOUBLE_IMG) )
-       changezerotonan(array, cropsize, bitpix);
+         && (bitpix==FLOAT_IMG || bitpix==DOUBLE_IMG) )
+        changezerotonan(array, cropsize, bitpix);
 
 
       /* If a polygon is given, remove all the pixels within or
@@ -735,21 +744,21 @@ onecrop(struct cropparams *crp)
       /* Write the array into the image. */
       status=0;
       if( fits_write_subset(ofp, p->datatype, fpixel_o, lpixel_o,
-                           array, &status) )
-       gal_fits_io_error(status, NULL);
+                            array, &status) )
+        gal_fits_io_error(status, NULL);
 
 
       /* A section has been added to the cropped image from this input
-        image, so increment crp->imgcount and save the information of
-        this image. */
+         image, so increment crp->imgcount and save the information of
+         this image. */
       sprintf(basename, "ICF%lu", ++p->log[crp->outindex].numimg);
       gal_fits_file_name_in_keywords(basename, img->name, &headers);
       sprintf(regionkey, "%sPIX", basename);
       sprintf(region, "%ld:%ld,%ld:%ld", fpixel_i[0], lpixel_i[0]+1,
-             fpixel_i[1], lpixel_i[1]+1);
+              fpixel_i[1], lpixel_i[1]+1);
       gal_fits_add_to_fits_header_ll_end(&headers, TSTRING, regionkey, 0,
-                                              region, 0, "Range of pixels "
-                                              "used for this output.", 0, 
NULL);
+                                         region, 0, "Range of pixels "
+                                         "used for this output.", 0, NULL);
       gal_fits_update_keys(ofp, &headers);
 
 
@@ -821,7 +830,7 @@ iscenterfilled(struct cropparams *crp)
   size=checkcenter*checkcenter;
   array=gal_fits_bitpix_alloc(size, bitpix);
   if( fits_read_subset(ofp, p->datatype, fpixel, lpixel, inc,
-                      p->bitnul, array, &anynul, &status) )
+                       p->bitnul, array, &anynul, &status) )
     gal_fits_io_error(status, NULL);
 
   /* Depending on bitpix, check the central pixels of the image. */
@@ -864,8 +873,8 @@ iscenterfilled(struct cropparams *crp)
 
     default:
       error(EXIT_FAILURE, 0, "in iscenterfilled, the bitbix is not "
-           "recognized! This is not possible by the user, so it is a "
-           "a bug. Please contact us so we can correct it");
+            "recognized! This is not possible by the user, so it is a "
+            "a bug. Please contact us so we can correct it");
     }
   free(array);
 
@@ -909,16 +918,16 @@ printlog(struct imgcropparams *p)
   if(p->up.catset && p->cp.verb)
     for(i=0;log[i].name;++i)
       if(log[i].numimg)
-       {
-         if(log[i].centerfilled || p->keepblankcenter)
-           {
-             ++numfiles;
-             if(log[i].numimg>1)
-               ++numstitched;
-           }
-         if(log[i].centerfilled)
-           ++numcentfilled;
-       }
+        {
+          if(log[i].centerfilled || p->keepblankcenter)
+            {
+              ++numfiles;
+              if(log[i].numimg>1)
+                ++numstitched;
+            }
+          if(log[i].centerfilled)
+            ++numcentfilled;
+        }
 
   /* Check to see if the file exists and remove if if it is ok. */
   gal_checkset_check_remove_file(LOGFILENAME, p->cp.dontdelete);
@@ -933,19 +942,19 @@ printlog(struct imgcropparams *p)
     {
       /* First print the comments to the file. */
       fprintf(logfile,
-             "# "SPACK_STRING" log file.\n"
-             "# "SPACK_NAME" was run on %s#\n",
-             ctime(&p->rawtime));
+              "# "SPACK_STRING" log file.\n"
+              "# "SPACK_NAME" was run on %s#\n",
+              ctime(&p->rawtime));
       if(p->keepblankcenter==0)
-       fprintf(logfile, "# NOTE: by default images with a blank "
-               "center are deleted.\n# To keep such images, run again "
-               "with `--keepblankcenter`.\n#\n");
+        fprintf(logfile, "# NOTE: by default images with a blank "
+                "center are deleted.\n# To keep such images, run again "
+                "with `--keepblankcenter`.\n#\n");
       fprintf(logfile,
-             "# Column numbers below start from zero.\n"
-             "# 0: Output file name.\n"
-             "# 1: Number of images used in this cropped image.\n"
-             "# 2: Are the central %lu pixels filled? (1: yes, 0: no)\n",
-             p->checkcenter);
+              "# Column numbers below start from zero.\n"
+              "# 0: Output file name.\n"
+              "# 1: Number of images used in this cropped image.\n"
+              "# 2: Are the central %lu pixels filled? (1: yes, 0: no)\n",
+              p->checkcenter);
 
       /* Then print each output's information. */
       for(i=0;log[i].name;++i)
@@ -954,23 +963,23 @@ printlog(struct imgcropparams *p)
 
       /* Report Summary: */
       if(p->cp.verb && p->up.catset)
-       {
-         sprintf(msg, "%lu images created.", numfiles);
-         gal_timing_report(NULL, msg, 1);
-         sprintf(msg, "%lu filled in the center.",
-                 numcentfilled);
-         gal_timing_report(NULL, msg, 1);
-         if(numstitched)
-           {
-             sprintf(msg, "%lu used more than one input.",
-                     numstitched);
-             gal_timing_report(NULL, msg, 1);
-           }
-       }
+        {
+          sprintf(msg, "%lu images created.", numfiles);
+          gal_timing_report(NULL, msg, 1);
+          sprintf(msg, "%lu filled in the center.",
+                  numcentfilled);
+          gal_timing_report(NULL, msg, 1);
+          if(numstitched)
+            {
+              sprintf(msg, "%lu used more than one input.",
+                      numstitched);
+              gal_timing_report(NULL, msg, 1);
+            }
+        }
 
       /* Close the file. */
       errno=0;
       if(fclose(logfile))
-       error(EXIT_FAILURE, errno, LOGFILENAME" could not be closed");
+        error(EXIT_FAILURE, errno, LOGFILENAME" could not be closed");
     }
 }
diff --git a/src/imgcrop/imgcrop.c b/src/imgcrop/imgcrop.c
index 8868cbe..e284550 100644
--- a/src/imgcrop/imgcrop.c
+++ b/src/imgcrop/imgcrop.c
@@ -78,25 +78,25 @@ imgmodecrop(void *inparam)
 
       /* Check the final output: */
       if(log->numimg)
-       {
+        {
           /* Check if the center of the crop is filled or not. */
-         log->centerfilled=iscenterfilled(crp);
+          log->centerfilled=iscenterfilled(crp);
 
-         /* Add the final headers and close output FITS image: */
-         gal_fits_copyright_end(crp->outfits, NULL, SPACK_STRING);
-         status=0;
-         if( fits_close_file(crp->outfits, &status) )
-           gal_fits_io_error(status, "CFITSIO could not close "
+          /* Add the final headers and close output FITS image: */
+          gal_fits_copyright_end(crp->outfits, NULL, SPACK_STRING);
+          status=0;
+          if( fits_close_file(crp->outfits, &status) )
+            gal_fits_io_error(status, "CFITSIO could not close "
                                    "the opened file");
 
-         /* Remove the output image if its center was not filled. */
-         if(log->centerfilled==0 && p->keepblankcenter==0)
-           {
-             errno=0;
-             if(unlink(log->name))
-               error(EXIT_FAILURE, errno, "%s", log->name);
-           }
-       }
+          /* Remove the output image if its center was not filled. */
+          if(log->centerfilled==0 && p->keepblankcenter==0)
+            {
+              errno=0;
+              if(unlink(log->name))
+                error(EXIT_FAILURE, errno, "%s", log->name);
+            }
+        }
       else log->centerfilled=0;
 
       /* Write the log entry for this crop, in this mode, each output image
@@ -168,65 +168,65 @@ wcsmodecrop(void *inparam)
 
 
       /* Go over all the images to see if this target is within their
-        range or not. */
+         range or not. */
       crp->imgindex=0;
       do
-       if(radecoverlap(crp))
-         {
-           gal_fits_read_hdu(p->imgs[crp->imgindex].name, p->cp.hdu,
+        if(radecoverlap(crp))
+          {
+            gal_fits_read_hdu(p->imgs[crp->imgindex].name, p->cp.hdu,
                                         IMAGE_HDU, &crp->infits);
 
-           if(log->name==NULL) cropname(crp);
+            if(log->name==NULL) cropname(crp);
 
-           onecrop(crp);
+            onecrop(crp);
 
-           status=0;
-           if( fits_close_file(crp->infits, &status) )
-             gal_fits_io_error(status, "imgmode.c: imgcroponthreads "
+            status=0;
+            if( fits_close_file(crp->infits, &status) )
+              gal_fits_io_error(status, "imgmode.c: imgcroponthreads "
                                      "could not close FITS file");
-         }
+          }
       while ( ++(crp->imgindex) < p->numimg );
 
 
       /* Check the final output: */
       if(log->numimg)
-       {
-         log->centerfilled=iscenterfilled(crp);
+        {
+          log->centerfilled=iscenterfilled(crp);
 
-         gal_fits_copyright_end(crp->outfits, NULL, SPACK_STRING);
-         status=0;
-         if( fits_close_file(crp->outfits, &status) )
-           gal_fits_io_error(status, "CFITSIO could not close the "
+          gal_fits_copyright_end(crp->outfits, NULL, SPACK_STRING);
+          status=0;
+          if( fits_close_file(crp->outfits, &status) )
+            gal_fits_io_error(status, "CFITSIO could not close the "
                                      "opened file");
 
-         if(log->centerfilled==0 && p->keepblankcenter==0)
-           {
-             errno=0;
-             if(unlink(log->name))
-               error(EXIT_FAILURE, errno, "%s", log->name);
-           }
-       }
+          if(log->centerfilled==0 && p->keepblankcenter==0)
+            {
+              errno=0;
+              if(unlink(log->name))
+                error(EXIT_FAILURE, errno, "%s", log->name);
+            }
+        }
       else
-       {
-         if(p->up.catset==0)   /* Trick cropname into making a catalog */
-           {                   /* So we have a name for log report. */
-             tcatset=1;
-             p->up.catset=1;
-           }
-         cropname(crp);
-         if(tcatset) p->up.catset=0;
-         log->centerfilled=0;
-       }
+        {
+          if(p->up.catset==0)    /* Trick cropname into making a catalog */
+            {                    /* So we have a name for log report.    */
+              tcatset=1;
+              p->up.catset=1;
+            }
+          cropname(crp);
+          if(tcatset) p->up.catset=0;
+          log->centerfilled=0;
+        }
 
       /* Write the log entry for this crop, in this mode, each output
-        image was only cropped from one image. Then print the result
-        on the terminal, if the user askd for it. */
+         image was only cropped from one image. Then print the result
+         on the terminal, if the user askd for it. */
       if(p->cp.verb)
-       {
-         sprintf(msg, "%-30s %lu %d", log->name, log->numimg,
-                 log->centerfilled);
-         gal_timing_report(NULL, msg, 2);
-       }
+        {
+          sprintf(msg, "%-30s %lu %d", log->name, log->numimg,
+                  log->centerfilled);
+          gal_timing_report(NULL, msg, 2);
+        }
     }
 
   /* Wait until all other threads finish. */
@@ -276,8 +276,8 @@ imgcrop(struct imgcropparams *p)
 
   if(!p->imgmode && !p->wcsmode)
     error(EXIT_FAILURE, 0, "a bug! Somehow in imgcrop (imgcrop.c), "
-         "neither the imgmode is on or the wcsmode! Please contact us "
-         "so we can fix it, thanks");
+          "neither the imgmode is on or the wcsmode! Please contact us "
+          "so we can fix it, thanks");
 
   /* Allocate the arrays to keep the thread and parameters for each
      thread. */
@@ -285,7 +285,7 @@ imgcrop(struct imgcropparams *p)
   crp=malloc(nt*sizeof *crp);
   if(crp==NULL)
     error(EXIT_FAILURE, errno,
-         "%lu bytes in imgcrop (imgcrop.c) for crp", nt*sizeof *crp);
+          "%lu bytes in imgcrop (imgcrop.c) for crp", nt*sizeof *crp);
 
 
   /* Get the length of the output, no reasonable integer can have more
@@ -308,35 +308,35 @@ imgcrop(struct imgcropparams *p)
       crp[0].p=p;
       crp[0].indexs=indexs;
       if(p->imgmode)
-       imgmodecrop(&crp[0]);
+        imgmodecrop(&crp[0]);
       else if(p->wcsmode)
-       wcsmodecrop(&crp[0]);
+        wcsmodecrop(&crp[0]);
     }
   else
     {
       /* Initialize the attributes. Note that this running thread
-        (that spinns off the nt threads) is also a thread, so the
-        number the barrier should be one more than the number of
-        threads spinned off. */
+         (that spinns off the nt threads) is also a thread, so the
+         number the barrier should be one more than the number of
+         threads spinned off. */
       if(p->cs0<nt) nb=p->cs0+1;
       else          nb=nt+1;
       gal_threads_attr_barrier_init(&attr, &b, nb);
 
       /* Spin off the threads: */
       for(i=0;i<nt;++i)
-       if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
-         {
-           crp[i].p=p;
-           crp[i].b=&b;
-           crp[i].outlen=crp[0].outlen;
-           crp[i].indexs=&indexs[i*thrdcols];
-           if(p->imgmode)
-             err=pthread_create(&t, &attr, imgmodecrop, &crp[i]);
-           else if(p->wcsmode)
-             err=pthread_create(&t, &attr, wcsmodecrop, &crp[i]);
-           if(err)
-             error(EXIT_FAILURE, 0, "can't create thread %lu", i);
-         }
+        if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
+          {
+            crp[i].p=p;
+            crp[i].b=&b;
+            crp[i].outlen=crp[0].outlen;
+            crp[i].indexs=&indexs[i*thrdcols];
+            if(p->imgmode)
+              err=pthread_create(&t, &attr, imgmodecrop, &crp[i]);
+            else if(p->wcsmode)
+              err=pthread_create(&t, &attr, wcsmodecrop, &crp[i]);
+            if(err)
+              error(EXIT_FAILURE, 0, "can't create thread %lu", i);
+          }
 
       /* Wait for all threads to finish and free the spaces. */
       pthread_barrier_wait(&b);
diff --git a/src/imgcrop/main.c b/src/imgcrop/main.c
index f43f5ef..c0c40fa 100644
--- a/src/imgcrop/main.c
+++ b/src/imgcrop/main.c
@@ -31,7 +31,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include "main.h"
 
 #include "imgcrop.h"
-#include "ui.h"                        /* needs main.h.                  */
+#include "ui.h"                 /* needs main.h.                  */
 
 int
 main (int argc, char *argv[])
diff --git a/src/imgcrop/ui.c b/src/imgcrop/ui.c
index f789029..82679ff 100644
--- a/src/imgcrop/ui.c
+++ b/src/imgcrop/ui.c
@@ -42,8 +42,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include "crop.h"
 #include "wcsmode.h"
 
-#include "ui.h"                        /* Needs main.h                   */
-#include "args.h"              /* Needs main.h, includes argp.h. */
+#include "ui.h"                  /* Needs main.h                   */
+#include "args.h"                /* Needs main.h, includes argp.h. */
 
 
 /* Set the file names of the places where the default parameters are
@@ -74,8 +74,8 @@ readconfig(char *filename, struct imgcropparams *p)
   struct uiparams *up=&p->up;
   size_t lineno=0, len=200, tmp;
   struct gal_commonparams *cp=&p->cp;
-  char key='a';        /* Not used, just a place holder. */
-  int imgmodeset=0, wcsmodeset=0; /* For unambiguous default file checking. */
+  char key='a';                   /* Not used, just a place holder.     */
+  int imgmodeset=0, wcsmodeset=0; /* Unambiguous default file checking. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
      might be intentional, so there is no error. If a parameter is
@@ -92,7 +92,7 @@ readconfig(char *filename, struct imgcropparams *p)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   /* Read the tokens in the file:  */
   while(getline(&line, &len, fp) != -1)
@@ -102,43 +102,43 @@ readconfig(char *filename, struct imgcropparams *p)
 
       /* Operating modes: */
       if(strcmp(name, "imgmode")==0)
-       {
-         gal_checkset_int_zero_or_one(value, &zeroorone, name, key, SPACK,
-                      filename, lineno);
-         if(zeroorone)
-           {
-             imgmodeset=1;
-             if(wcsmodeset)
-               error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                             "Image and WCS modes cannot be called "
-                             "together. It is ambiguous.");
-             if(up->imgmodeset==0)
-               {
-                 p->imgmode=1;
-                 p->wcsmode=0;
-                 up->imgmodeset=up->wcsmodeset=1;
-               }
-           }
-       }
+        {
+          gal_checkset_int_zero_or_one(value, &zeroorone, name, key, SPACK,
+                       filename, lineno);
+          if(zeroorone)
+            {
+              imgmodeset=1;
+              if(wcsmodeset)
+                error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                              "Image and WCS modes cannot be called "
+                              "together. It is ambiguous.");
+              if(up->imgmodeset==0)
+                {
+                  p->imgmode=1;
+                  p->wcsmode=0;
+                  up->imgmodeset=up->wcsmodeset=1;
+                }
+            }
+        }
       else if(strcmp(name, "wcsmode")==0)
-       {
-         gal_checkset_int_zero_or_one(value, &zeroorone, name, key, SPACK,
-                      filename, lineno);
-         if(zeroorone)
-           {
-             wcsmodeset=1;
-             if(imgmodeset)
-               error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                             "Image and WCS modes cannot be called "
-                             "together. It is ambiguous.");
-             if(up->wcsmodeset==0)
-               {
-                 p->imgmode=0;
-                 p->wcsmode=1;
-                 up->imgmodeset=up->wcsmodeset=1;
-               }
-           }
-       }
+        {
+          gal_checkset_int_zero_or_one(value, &zeroorone, name, key, SPACK,
+                       filename, lineno);
+          if(zeroorone)
+            {
+              wcsmodeset=1;
+              if(imgmodeset)
+                error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                              "Image and WCS modes cannot be called "
+                              "together. It is ambiguous.");
+              if(up->wcsmodeset==0)
+                {
+                  p->imgmode=0;
+                  p->wcsmode=1;
+                  up->imgmodeset=up->wcsmodeset=1;
+                }
+            }
+        }
 
 
 
@@ -149,100 +149,100 @@ readconfig(char *filename, struct imgcropparams *p)
         gal_checkset_allocate_copy_set(value, &cp->hdu, &cp->hduset);
 
       else if(strcmp(name, "racol")==0)
-       {
-         if(up->racolset) continue;
-         gal_checkset_sizet_el_zero(value, &p->racol, name, key, SPACK,
-                     filename, lineno);
-         up->racolset=1;
-       }
+        {
+          if(up->racolset) continue;
+          gal_checkset_sizet_el_zero(value, &p->racol, name, key, SPACK,
+                      filename, lineno);
+          up->racolset=1;
+        }
       else if(strcmp(name, "deccol")==0)
-       {
-         if(up->deccolset) continue;
-         gal_checkset_sizet_el_zero(value, &p->deccol, name, key, SPACK,
-                     filename, lineno);
-         up->deccolset=1;
-       }
+        {
+          if(up->deccolset) continue;
+          gal_checkset_sizet_el_zero(value, &p->deccol, name, key, SPACK,
+                      filename, lineno);
+          up->deccolset=1;
+        }
       else if(strcmp(name, "xcol")==0)
-       {
-         if(up->xcolset) continue;
-         gal_checkset_sizet_el_zero(value, &p->xcol, name, key, SPACK,
-                     filename, lineno);
-         up->xcolset=1;
-       }
+        {
+          if(up->xcolset) continue;
+          gal_checkset_sizet_el_zero(value, &p->xcol, name, key, SPACK,
+                      filename, lineno);
+          up->xcolset=1;
+        }
       else if(strcmp(name, "ycol")==0)
-       {
-         if(up->ycolset) continue;
-         gal_checkset_sizet_el_zero(value, &p->ycol, name, key, SPACK,
-                     filename, lineno);
-         up->ycolset=1;
-       }
+        {
+          if(up->ycolset) continue;
+          gal_checkset_sizet_el_zero(value, &p->ycol, name, key, SPACK,
+                      filename, lineno);
+          up->ycolset=1;
+        }
       else if(strcmp(name, "iwidth")==0)
-       {
-         if(up->iwidthset) continue;
-         gal_checkset_sizet_l_zero(value, &tmp, name, key, SPACK,
-                    filename, lineno);
-         p->iwidth[0]=p->iwidth[1]=tmp;
-         up->iwidthset=1;
-       }
+        {
+          if(up->iwidthset) continue;
+          gal_checkset_sizet_l_zero(value, &tmp, name, key, SPACK,
+                     filename, lineno);
+          p->iwidth[0]=p->iwidth[1]=tmp;
+          up->iwidthset=1;
+        }
       else if(strcmp(name, "wwidth")==0)
-       {
-         if(up->wwidthset) continue;
-         gal_checkset_double_l_0(value, &p->wwidth, name, key, SPACK,
-                  filename, lineno);
-         up->wwidthset=1;
-       }
+        {
+          if(up->wwidthset) continue;
+          gal_checkset_double_l_0(value, &p->wwidth, name, key, SPACK,
+                   filename, lineno);
+          up->wwidthset=1;
+        }
       else if(strcmp(name, "hstartwcs")==0)
-       {
-         if(up->hstartwcsset) continue;
-         gal_checkset_sizet_el_zero(value, &p->hstartwcs, name, key, SPACK,
+        {
+          if(up->hstartwcsset) continue;
+          gal_checkset_sizet_el_zero(value, &p->hstartwcs, name, key, SPACK,
                       filename, lineno);
-         up->hstartwcsset=1;
-       }
+          up->hstartwcsset=1;
+        }
       else if(strcmp(name, "hendwcs")==0)
-       {
-         if(up->hendwcsset) continue;
-         gal_checkset_sizet_el_zero(value, &p->hendwcs, name, key, SPACK,
+        {
+          if(up->hendwcsset) continue;
+          gal_checkset_sizet_el_zero(value, &p->hendwcs, name, key, SPACK,
                       filename, lineno);
-         up->hendwcsset=1;
-       }
+          up->hendwcsset=1;
+        }
 
 
 
       /* Outputs */
       else if(strcmp(name, "checkcenter")==0)
-       {
-         if(up->checkcenterset) continue;
-         gal_checkset_sizet_el_zero(value, &p->checkcenter, name, key, SPACK,
-                     filename, lineno);
-         up->checkcenterset=1;
-       }
+        {
+          if(up->checkcenterset) continue;
+          gal_checkset_sizet_el_zero(value, &p->checkcenter, name, key,
+                                     SPACK, filename, lineno);
+          up->checkcenterset=1;
+        }
       else if(strcmp(name, "output")==0)
-       {
-         if(cp->outputset) continue;
-         errno=0;
-         cp->output=malloc(strlen(value)+1);
-         if(cp->output==NULL)
-           error(EXIT_FAILURE, errno, "space for output");
-         strcpy(cp->output, value);
-         cp->outputset=1;
-       }
+        {
+          if(cp->outputset) continue;
+          errno=0;
+          cp->output=malloc(strlen(value)+1);
+          if(cp->output==NULL)
+            error(EXIT_FAILURE, errno, "space for output");
+          strcpy(cp->output, value);
+          cp->outputset=1;
+        }
       else if(strcmp(name, "suffix")==0)
-       {
-         if(up->suffixset) continue;
-         errno=0;
-         p->suffix=malloc(strlen(value)+1);
-         if(p->suffix==NULL)
-           error(EXIT_FAILURE, errno, "space for prefix");
-         strcpy(p->suffix, value);
-         up->suffixset=1;
-       }
+        {
+          if(up->suffixset) continue;
+          errno=0;
+          p->suffix=malloc(strlen(value)+1);
+          if(p->suffix==NULL)
+            error(EXIT_FAILURE, errno, "space for prefix");
+          strcpy(p->suffix, value);
+          up->suffixset=1;
+        }
 
       /* Read options common to all programs */
       GAL_CONFIGFILES_READ_COMMONOPTIONS_FROM_CONF
 
       else
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     "`%s` not recognized.\n", name);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      "`%s` not recognized.\n", name);
     }
 
   free(line);
@@ -398,10 +398,10 @@ sanitycheck(struct imgcropparams *p)
   /* deccol!=racol and xcol!=ycol */
   if(p->racol==p->deccol)
     error(EXIT_FAILURE, 0, "the columns for RA and Dec must be "
-         "different");
+          "different");
   if(p->xcol==p->ycol)
     error(EXIT_FAILURE, 0, "the columns for x and y must be "
-         "different");
+          "different");
 
 
 
@@ -411,7 +411,7 @@ sanitycheck(struct imgcropparams *p)
   if(checksum==2) {p->imgmode=0; p->wcsmode=1;}
   else if(checksum)/* is not zero */
     error(EXIT_FAILURE, 0, "the options `--ra` and `--dec` should be "
-         "called together");
+          "called together");
 
 
 
@@ -421,7 +421,7 @@ sanitycheck(struct imgcropparams *p)
   if(checksum==2) {p->imgmode=1; p->wcsmode=0;}
   else if(checksum)/* is not zero */
     error(EXIT_FAILURE, 0, "the options `--xc` and `--yc` should be "
-         "called together");
+          "called together");
 
 
 
@@ -448,68 +448,69 @@ sanitycheck(struct imgcropparams *p)
           if(up->polygonset)
             strcat(forerr, "(`--polygon'), ");
           error(EXIT_FAILURE, 0, "there are several ways to specify a crop "
-                "box on the command line, see `--help`. But they should not "
-                "be called together. You have asked for %s simultaneously",
-                forerr);
+                "box on the command line, see `--help`. But they should "
+                "not be called together. You have asked for %s "
+                "simultaneously", forerr);
         }
 
       /* Check if the value for --output is a file or a directory? */
-      p->outnameisfile=gal_checkset_dir_0_file_1(cp->output, cp->dontdelete);
+      p->outnameisfile=gal_checkset_dir_0_file_1(cp->output,
+                                                 cp->dontdelete);
 
       /* When there is only one output, only one thread is needed. */
       cp->numthreads=1;
 
       /* Not with a catalog. */
       if(up->catname)
-       {
+        {
           if(up->sectionset) strcpy(forerr, "`--section'");
           if(up->polygonset) strcpy(forerr, "`--polygon'");
           if(up->xcset) strcpy(forerr, "`--xc' and `--yc'");
-         if(up->raset) strcpy(forerr, "`--ra' and `--dec'");
-         error(EXIT_FAILURE, 0, "a catalog name (%s) and command line crop "
-               "parameters (%s) cannot be given together", up->catname,
-                forerr);
-       }
+          if(up->raset) strcpy(forerr, "`--ra' and `--dec'");
+          error(EXIT_FAILURE, 0, "a catalog name (%s) and command line "
+                "crop parameters (%s) cannot be given together",
+                up->catname, forerr);
+        }
     }
   else
     {
       /* Only one mode. Note that when the box is specified on the
-        command line, in the steps above, we set the image mode or
-        wcs mode.*/
+         command line, in the steps above, we set the image mode or
+         wcs mode.*/
       if(p->imgmode && p->wcsmode)
-       error(EXIT_FAILURE, 0, "only one of imgmode or wcsmode "
-             "must be called. They cannot operate together");
+        error(EXIT_FAILURE, 0, "only one of imgmode or wcsmode "
+              "must be called. They cannot operate together");
       else if(p->imgmode==0 && p->wcsmode==0)
-       error(EXIT_FAILURE, 0, "at least one of imgmode or "
-             "wcsmode must be called");
+        error(EXIT_FAILURE, 0, "at least one of imgmode or "
+              "wcsmode must be called");
 
       /* Make sure a catalog is set. */
       if(up->catset)
-       {
-         if(p->numimg>1 && p->imgmode)
-           error(EXIT_FAILURE, 0, "in image mode, when a catalog is "
-                 "specified, only one image may be provided");
-       }
+        {
+          if(p->numimg>1 && p->imgmode)
+            error(EXIT_FAILURE, 0, "in image mode, when a catalog is "
+                  "specified, only one image may be provided");
+        }
       else
-       error(EXIT_FAILURE, 0, "no catalog. When no crop coordinates "
-             "are specified on the command line, a catalog must be "
-             "provided");
+        error(EXIT_FAILURE, 0, "no catalog. When no crop coordinates "
+              "are specified on the command line, a catalog must be "
+              "provided");
 
       /* Make sure the given output is a directory. */
       gal_checkset_check_dir_write_add_slash(&cp->output);
 
       /* Make sure the columns of data are within the catalog range of
-        columns: */
+         columns: */
       if(p->imgmode)
-       {
-         GAL_CHECKSET_CHECK_COL_IN_CAT(p->xcol, "xcol");
-         GAL_CHECKSET_CHECK_COL_IN_CAT(p->ycol, "ycol");
-       }
+        {
+          GAL_CHECKSET_CHECK_COL_IN_CAT(p->xcol, "xcol");
+          GAL_CHECKSET_CHECK_COL_IN_CAT(p->ycol, "ycol");
+        }
       else
-       {
-         GAL_CHECKSET_CHECK_COL_IN_CAT(p->racol, "racol");
-         GAL_CHECKSET_CHECK_COL_IN_CAT(p->deccol, "deccol");
-       }
+        {
+          GAL_CHECKSET_CHECK_COL_IN_CAT(p->racol, "racol");
+          GAL_CHECKSET_CHECK_COL_IN_CAT(p->deccol, "deccol");
+        }
     }
 
 
@@ -517,7 +518,7 @@ sanitycheck(struct imgcropparams *p)
   /* If in image mode, there should only be one input image. */
   if(p->imgmode && p->numimg>1)
     error(EXIT_FAILURE, 0, "in image mode, only one input image may be "
-         "specified");
+          "specified");
 
 
 
@@ -525,7 +526,7 @@ sanitycheck(struct imgcropparams *p)
   /* If we are in WCS mode, noblanks must be off */
   if(p->wcsmode && p->noblank)
     error(EXIT_FAILURE, 0, "`--noblanks` (`-b`) is only for image mode. "
-         "You have called it with WCS mode");
+          "You have called it with WCS mode");
 
 
 
@@ -555,12 +556,12 @@ sanitycheck(struct imgcropparams *p)
      because the number of threads may change above. */
   if(cp->numthreads>1 && fits_is_reentrant()==0)
     error(EXIT_FAILURE, 0, "CFITSIO was not configured with the "
-         "`--enable-reentrant` option but you have asked to operate "
-         "on %lu threads. Please configure, make and install CFITSIO "
-         "again with this flag to use multiple threads, run `info %s "
-         "CFITSIO` for more information. Alternatively you can set "
-         "the number of threads to 1 by adding the `--numthreads=1` "
-         "or `-N1` options", cp->numthreads, PACKAGE);
+          "`--enable-reentrant` option but you have asked to operate "
+          "on %lu threads. Please configure, make and install CFITSIO "
+          "again with this flag to use multiple threads, run `info %s "
+          "CFITSIO` for more information. Alternatively you can set "
+          "the number of threads to 1 by adding the `--numthreads=1` "
+          "or `-N1` options", cp->numthreads, PACKAGE);
 }
 
 
@@ -642,21 +643,21 @@ preparearrays(struct imgcropparams *p)
       gal_fits_io_error(status, NULL);
 
       /* Make sure all the images have the same BITPIX and set the
-        basic BITPIX related parameters. */
+         basic BITPIX related parameters. */
       if(firstbitpix==0)
-       {
-         firstbitpix=p->bitpix;
-         p->datatype=gal_fits_bitpix_to_dtype(p->bitpix);
-         p->bitnul=gal_fits_bitpix_blank(p->bitpix);
-       }
+        {
+          firstbitpix=p->bitpix;
+          p->datatype=gal_fits_bitpix_to_dtype(p->bitpix);
+          p->bitnul=gal_fits_bitpix_blank(p->bitpix);
+        }
       else if(firstbitpix!=p->bitpix)
-       error(EXIT_FAILURE, 0, "%s: BITPIX=%d. Previous images had a "
-             "BITPIX value of %d, For "SPACK_NAME" to work, all images "
-             "must have the same pixel data type",
-             img->name, p->bitpix, firstbitpix);
+        error(EXIT_FAILURE, 0, "%s: BITPIX=%d. Previous images had a "
+              "BITPIX value of %d, For "SPACK_NAME" to work, all images "
+              "must have the same pixel data type",
+              img->name, p->bitpix, firstbitpix);
 
       /* In WCS mode, Check resolution and get the first pixel
-        positions. */
+         positions. */
       if(p->wcsmode) wcscheckprepare(p, img);
     }
 
@@ -672,7 +673,7 @@ preparearrays(struct imgcropparams *p)
   p->log=calloc(num+1, sizeof *p->log);
   if(p->log==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes for p->log",
-         num+1 * sizeof *p->log);
+          num+1 * sizeof *p->log);
 
   /* Report timing: */
   if(p->cp.verb)
diff --git a/src/imgcrop/wcsmode.c b/src/imgcrop/wcsmode.c
index 989fa8b..6d5132a 100644
--- a/src/imgcrop/wcsmode.c
+++ b/src/imgcrop/wcsmode.c
@@ -60,61 +60,61 @@ wcscheckprepare(struct imgcropparams *p, struct inputimgs 
*img)
      resolution of other images. */
   if(wcs->pc[1]!=0.0f || wcs->pc[2]!=0.0f)
     error(EXIT_FAILURE, 0, "%s: HDU %s: is not aligned to the "
-         "celestial coordinates. The first FITS axis should be "
-         "along the Right Ascension and the second FITS axis "
-         "should be along the declination. You should rotate "
-         "(interpolate) the images with other software",
-         img->name, p->cp.hdu);
+          "celestial coordinates. The first FITS axis should be "
+          "along the Right Ascension and the second FITS axis "
+          "should be along the declination. You should rotate "
+          "(interpolate) the images with other software",
+          img->name, p->cp.hdu);
   if(wcs->pc[0]>0)
     error(EXIT_FAILURE, 0, "%s: HDU %s: An increase in the first "
-         "FITS axis pixel coordinates should be a decrese in the "
-         "RA. You have to flip the image along the second axis "
-         "before running ImageCrop", img->name, p->cp.hdu);
+          "FITS axis pixel coordinates should be a decrese in the "
+          "RA. You have to flip the image along the second axis "
+          "before running ImageCrop", img->name, p->cp.hdu);
   if(wcs->pc[3]<0)
     error(EXIT_FAILURE, 0, "%s: HDU %s: An increase in the second "
-         "FITS axis pixel coordinates should translate to an "
-         "increase in the declination. You have to flip the "
-         "image along the first axis before running ImageCrop",
-         img->name, p->cp.hdu);
+          "FITS axis pixel coordinates should translate to an "
+          "increase in the declination. You have to flip the "
+          "image along the first axis before running ImageCrop",
+          img->name, p->cp.hdu);
   /* Since we are dealing with very accurate values, a multiplication
      by -1 might cause a floating point error. So we have to account
      for the floating point error. */
   if(-1.0f*wcs->pc[0]<wcs->pc[3]-1e-15 || -1.0f*wcs->pc[0]>wcs->pc[3]+1e-15)
     error(EXIT_FAILURE, 0, "%s: HDU %s: The pixel scale along "
-         "the two image axises is not the same. The first axis "
-         "is %f arcseconds/pixel, while the second is %f",
-         img->name, p->cp.hdu, 3600*-1.0f*wcs->pc[0],
-         3600*wcs->pc[3]);
+          "the two image axises is not the same. The first axis "
+          "is %f arcseconds/pixel, while the second is %f",
+          img->name, p->cp.hdu, 3600*-1.0f*wcs->pc[0],
+          3600*wcs->pc[3]);
   if(p->res==0.0f)
     {
       /* Set the resolution of the image. */
       p->res=wcs->pc[3];
 
       /* Set the widths such that iwidth and wwidth are exactly the same
-        (within their different units ofcourse). Also make sure that the
-        image size is an odd number (so the central pixel is in the
-        center). */
-      p->wwidth/=3600;          /* Convert the width to degrees. */
+         (within their different units ofcourse). Also make sure that the
+         image size is an odd number (so the central pixel is in the
+         center). */
+      p->wwidth/=3600;                 /* Convert the width to degrees. */
       twidth=p->wwidth/p->res;
       if(twidth<3)
-       error(EXIT_FAILURE, 0, "--wwidth = %f (arcseconds) translates "
-             "to %.0f pixels in scale of input image(s). This is probably "
-             "not what you want", p->wwidth*3600, twidth);
+        error(EXIT_FAILURE, 0, "--wwidth = %f (arcseconds) translates "
+              "to %.0f pixels in scale of input image(s). This is probably "
+              "not what you want", p->wwidth*3600, twidth);
       p->iwidth[0] = (twidth-(long)twidth)>0.5 ? twidth+1 : twidth;
       if(p->iwidth[0]%2==0)
-       {
-         p->iwidth[0]+=1;
-         p->wwidth+=p->res;
-       }
+        {
+          p->iwidth[0]+=1;
+          p->wwidth+=p->res;
+        }
       p->iwidth[1]=p->iwidth[0];
     }
   else
     if(p->res!=wcs->pc[3])
       error(EXIT_FAILURE, 0, "%s: HDU %s: The resolution of "
-           "this image is %f arcseconds/pixel while the "
-           "previously checked input image(s) had a resolution "
-           "of %f", img->name, p->cp.hdu, 3600*wcs->pc[3],
-           3600*p->res);
+            "this image is %f arcseconds/pixel while the "
+            "previously checked input image(s) had a resolution "
+            "of %f", img->name, p->cp.hdu, 3600*wcs->pc[3],
+            3600*p->res);
 
 
   /* Get the coordinates of the first pixel in the image. */
@@ -123,10 +123,10 @@ wcscheckprepare(struct imgcropparams *p, struct inputimgs 
*img)
   pixcrd[4]=1;               pixcrd[5]=img->naxes[1];
   pixcrd[6]=img->naxes[0];   pixcrd[7]=img->naxes[1];
   wcsp2s(wcs, ncoord, nelem, pixcrd, imgcrd, phi, theta,
-        img->corners, &status);
+         img->corners, &status);
   if(status)
     error(EXIT_FAILURE, 0, "wcsp2s ERROR %d: %s", status,
-         wcs_errmsg[status]);
+          wcs_errmsg[status]);
 
 
   /* Fill in the size of the image in celestial degrees from the first
@@ -142,7 +142,7 @@ wcscheckprepare(struct imgcropparams *p, struct inputimgs 
*img)
     {
       /* re in the explanations. */
       img->equatorcorr[0]=img->corners[0]
-       -0.5*img->sized[0]*(1-cos(img->corners[1]*M_PI/180));
+        -0.5*img->sized[0]*(1-cos(img->corners[1]*M_PI/180));
 
       /* sre in the explanations. */
       img->equatorcorr[1]=img->sized[0]*cos(img->corners[1]*M_PI/180);
@@ -151,11 +151,11 @@ wcscheckprepare(struct imgcropparams *p, struct inputimgs 
*img)
 
   /* Just to check:
   printf("\n\n%s:\n(%.10f, %.10f)\n(%.10f, %.10f)"
-        "\n(%.10f, %.10f)\n(%.10f, %.10f)\n\n", img->name,
-        img->corners[0], img->corners[1],
-        img->corners[2], img->corners[3],
-        img->corners[4], img->corners[5],
-        img->corners[6], img->corners[7]);
+         "\n(%.10f, %.10f)\n(%.10f, %.10f)\n\n", img->name,
+         img->corners[0], img->corners[1],
+         img->corners[2], img->corners[3],
+         img->corners[4], img->corners[5],
+         img->corners[6], img->corners[7]);
   exit(0);
   */
 }
@@ -193,7 +193,7 @@ void
 setcsides(struct cropparams *crp)
 {
   size_t i;
-  double h, hr, r, d, dr;      /* The second r is for radians. */
+  double h, hr, r, d, dr;        /* The second r is for radians. */
   struct imgcropparams *p=crp->p;
   double minra=FLT_MAX, mindec=FLT_MAX;
   double maxra=-FLT_MAX, maxdec=-FLT_MAX;
@@ -255,7 +255,7 @@ setcsides(struct cropparams *crp)
     {
       /* re in the explanations. */
       crp->equatorcorr[0]=crp->corners[0]
-       -0.5*crp->sized[0]*(1-cos(crp->corners[1]*M_PI/180));
+        -0.5*crp->sized[0]*(1-cos(crp->corners[1]*M_PI/180));
 
       /* sre in the explanations. */
       crp->equatorcorr[1]=crp->sized[0]*cos(crp->corners[1]*M_PI/180);
@@ -263,12 +263,12 @@ setcsides(struct cropparams *crp)
 
   /* Just to check:
   printf("\n\nCorner 1: (%.10f, %.10f)\n"
-        "Corner 2: (%.10f, %.10f)\nCorner 3: (%.10f, %.10f)\n"
+         "Corner 2: (%.10f, %.10f)\nCorner 3: (%.10f, %.10f)\n"
          "Corner 4: (%.10f, %.10f)\n\n",
-        crp->corners[0], crp->corners[1],
-        crp->corners[2], crp->corners[3],
-        crp->corners[4], crp->corners[5],
-        crp->corners[6], crp->corners[7]);
+         crp->corners[0], crp->corners[1],
+         crp->corners[2], crp->corners[3],
+         crp->corners[4], crp->corners[5],
+         crp->corners[6], crp->corners[7]);
   */
 }
 
@@ -349,7 +349,7 @@ fillcrpipolygon(struct cropparams *crp)
 
            (r3-r4)=(r1-r2)/cos(d3-d1)            (North)
 
-          (r1-r2)=(r3-r4)/cos(d1-d3)            (South)
+           (r1-r2)=(r3-r4)/cos(d1-d3)            (South)
 
    QUESTION:
    ========
@@ -411,27 +411,27 @@ radecinimg(double *p, double *i, double *s, double *c)
      safely return 0.*/
   if(p[1]>=i[1]  && p[1]<=i[1]+s[1])
     {
-      if(p[1]<=0)          /* Point is in southern hemisphere, it       */
-       {                   /* doesn't matter if image passes equator!   */
-         n=0.5f*s[0]*( 1 - cos((p[1]-i[1])*M_PI/180) );
-         if(p[0]<=i[0]-n   &&   p[0]>=i[0]-s[0]+n)
-           return 1;
-       }
-      else                      /* Point is in the northern hemisphere. */
-       {
-         if( i[1] * (s[1]+i[1]) > 0 )  /* Image does not cross equator. */
-           {
-             n=0.5f*s[0]*( 1/cos((p[1]-i[1])*M_PI/180) - 1);
-             if(p[0]<=i[0]+n   &&   p[0]>=i[0]-s[0]-n)
-               return 1;
-           }
-         else                              /* Image crosses the equator.*/
-           {
-             n=0.5f*c[1]*( 1/cos((p[1]     )*M_PI/180) - 1);
-             if(p[0]<=c[0]+n   &&   p[0]>=c[0]-c[1]-n)
-               return 1;
-           }
-       }
+      if(p[1]<=0)            /* Point is in southern hemisphere, it     */
+        {                    /* doesn't matter if image passes equator! */
+          n=0.5f*s[0]*( 1 - cos((p[1]-i[1])*M_PI/180) );
+          if(p[0]<=i[0]-n   &&   p[0]>=i[0]-s[0]+n)
+            return 1;
+        }
+      else                      /* Point is in the northern hemisphere. */
+        {
+          if( i[1] * (s[1]+i[1]) > 0 ) /* Image does not cross equator. */
+            {
+              n=0.5f*s[0]*( 1/cos((p[1]-i[1])*M_PI/180) - 1);
+              if(p[0]<=i[0]+n   &&   p[0]>=i[0]-s[0]-n)
+                return 1;
+            }
+          else                             /* Image crosses the equator.*/
+            {
+              n=0.5f*c[1]*( 1/cos((p[1]     )*M_PI/180) - 1);
+              if(p[0]<=c[0]+n   &&   p[0]>=c[0]-c[1]-n)
+                return 1;
+            }
+        }
     }
   return 0;
 }
@@ -455,7 +455,7 @@ int
 radecoverlap(struct cropparams *crp)
 {
   double *d, *fd;
-  double *i, *s, *c;           /* for clear viewing. */
+  double *i, *s, *c;                /* for clear viewing. */
 
   /* First check if the four sides of the crop box are in the image.*/
   fd=(d=crp->corners)+8;
diff --git a/src/imgstat/args.h b/src/imgstat/args.h
index f293a5b..1ba3c1b 100644
--- a/src/imgstat/args.h
+++ b/src/imgstat/args.h
@@ -397,9 +397,9 @@ parse_opt(int key, char *arg, struct argp_state *state)
      user is warned and the program is stopped: */
   if(arg && arg[0]=='=')
     argp_error(state, "incorrect use of the equal sign (`=`). For short "
-              "options, `=` should not be used and for long options, "
-              "there should be no space between the option, equal sign "
-              "and value");
+               "options, `=` should not be used and for long options, "
+               "there should be no space between the option, equal sign "
+               "and value");
 
   switch(key)
     {
@@ -543,7 +543,7 @@ parse_opt(int key, char *arg, struct argp_state *state)
             argp_error(state, "only one input image should be given");
           else
             p->up.inputname=arg;
-       }
+        }
       else
         argp_error(state, "%s is not a valid file type", arg);
       break;
@@ -555,13 +555,13 @@ parse_opt(int key, char *arg, struct argp_state *state)
     /* The command line options and arguments are finished. */
     case ARGP_KEY_END:
       if(p->cp.setdirconf==0 && p->cp.setusrconf==0
-        && p->cp.printparams==0)
-       {
-         if(state->arg_num==0)
-           argp_error(state, "no argument given");
-         if(p->up.inputname==NULL)
-           argp_error(state, "no input FITS image(s) provided");
-       }
+         && p->cp.printparams==0)
+        {
+          if(state->arg_num==0)
+            argp_error(state, "no argument given");
+          if(p->up.inputname==NULL)
+            argp_error(state, "no input FITS image(s) provided");
+        }
       break;
 
 
@@ -591,6 +591,6 @@ struct argp_child children[]=
 
 /* Basic structure defining the whole argument reading process. */
 static struct argp thisargp = {options, parse_opt, args_doc,
-                              doc, children, NULL, NULL};
+                               doc, children, NULL, NULL};
 
 #endif
diff --git a/src/imgstat/cite.h b/src/imgstat/cite.h
index 074bd84..4193345 100644
--- a/src/imgstat/cite.h
+++ b/src/imgstat/cite.h
@@ -25,14 +25,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #define IMGSTATBIBTEX ""
 
-#define PRINTCITEABORT {                                               \
-    printf("\nWe hope %s has been useful for your research.\n"         \
-          "Citations are vital for the continued work on %s.\n"        \
-          "Thank you for citing it in your research paper.\n"          \
-          "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
-          SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
-           GAL_STRINGS_MAIN_BIBTEX, IMGSTATBIBTEX);                    \
-    exit(EXIT_SUCCESS);                                                        
\
+#define PRINTCITEABORT {                                                \
+    printf("\nWe hope %s has been useful for your research.\n"          \
+           "Citations are vital for the continued work on %s.\n"        \
+           "Thank you for citing it in your research paper.\n"          \
+           "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
+           SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
+           GAL_STRINGS_MAIN_BIBTEX, IMGSTATBIBTEX);                     \
+    exit(EXIT_SUCCESS);                                                 \
 }
 
 #endif
diff --git a/src/imgstat/imgstat.c b/src/imgstat/imgstat.c
index 09099d2..e07b5b6 100644
--- a/src/imgstat/imgstat.c
+++ b/src/imgstat/imgstat.c
@@ -55,9 +55,9 @@ reportsimplestats(struct imgstatparams *p)
 
   /* Very simple and basic: */
   printf(SNAMEVAL FNAMEVAL FNAMEVAL, "Number of points", p->size,
-        "Minimum", p->sorted[0], "Maximum", p->sorted[p->size-1]);
+         "Minimum", p->sorted[0], "Maximum", p->sorted[p->size-1]);
   printf(FNAMEVAL FNAMEVAL FNAMEVAL FNAMEVAL, "Sum", sum, "Mean", ave,
-        "Standard deviation", std, "Median", med);
+         "Standard deviation", std, "Median", med);
 
   /* The mode: */
   gal_mode_index_in_sorted(p->sorted, p->size, p->mirrordist, &modeindex,
@@ -108,16 +108,16 @@ printasciihist(struct imgstatparams *p)
 
   /* Plot the ASCII histogram: */
   printf("   -- ASCII histogram in the range: %f  --  %f:\n",
-        p->histmin, p->histmax);
+         p->histmin, p->histmax);
   for(i=ASCIIHISTHEIGHT;i>=0;--i)
     {
       printf("    |");
       for(j=0;j<ASCIIHISTNUMBINS;++j)
-       {
-         if(bins[j*2+1]>=((float)i-0.5f)
-            && bins[j*2+1]>0.0f) printf("*");
-         else printf(" ");
-       }
+        {
+          if(bins[j*2+1]>=((float)i-0.5f)
+             && bins[j*2+1]>0.0f) printf("*");
+          else printf(" ");
+        }
       printf("\n");
     }
   printf("    |");
@@ -150,7 +150,7 @@ printhistcfp(struct imgstatparams *p, float *bins, size_t 
numbins,
   /* Get the time to print on the report. */
   time(&rawtime);
   fprintf(out, "# %s \n# %s, created on %s", SPACK_STRING, outputtype,
-         ctime(&rawtime));
+          ctime(&rawtime));
   fprintf(out, "# Input (hdu): %s (%s)\n", p->up.inputname, p->cp.hdu);
   if(p->up.masknameset)
     fprintf(out, "# Mask (hdu): %s (%s)\n", p->up.maskname, p->up.mhdu);
@@ -234,32 +234,32 @@ imgstat(struct imgstatparams *p)
       /* Get the hisogram maximum value if it is needed for the
          cumulative frequency plot. */
       if(p->maxcfpeqmaxhist)
-       for(i=0;i<p->histnumbins;++i)
-         if(bins[i*2+1]>maxhist)
-           maxhist=bins[i*2+1];
+        for(i=0;i<p->histnumbins;++i)
+          if(bins[i*2+1]>maxhist)
+            maxhist=bins[i*2+1];
     }
 
   /* Make the cumulative distribution function: */
   if(p->cfpname)
     {
       if(p->cfpsimhist)
-       {
-         p->cfpnum=p->histnumbins;
-         for(i=0;i<p->cfpnum;++i)
-           bins[i*2+1]=0.0f;
-       }
+        {
+          p->cfpnum=p->histnumbins;
+          for(i=0;i<p->cfpnum;++i)
+            bins[i*2+1]=0.0f;
+        }
       else
-       {
-         if(p->histname) free(bins);
+        {
+          if(p->histname) free(bins);
           gal_statistics_set_bins(p->sorted, p->size, p->cfpnum, p->cfpmin,
                                   p->cfpmax, p->onebinvalue, quant, &bins);
-       }
+        }
       gal_statistics_cumulative_fp(p->sorted, p->size, bins,
                                    p->cfpnum, p->normcfp);
 
       if(p->maxcfpeqmaxhist)
-       for(i=0;i<p->cfpnum;++i)
-         bins[i*2+1]*=(maxhist/p->size);
+        for(i=0;i<p->cfpnum;++i)
+          bins[i*2+1]*=(maxhist/p->size);
 
       printhistcfp(p, bins, p->cfpnum, p->cfpname, CFPSTRING);
     }
@@ -287,7 +287,7 @@ imgstat(struct imgstatparams *p)
       if(r==0)
         printf("   #### Could not converge\n");
       printf("   - %.2f sigma-clipping %lu times:\n",
-            p->sigclipmultip, p->sigclipnum);
+             p->sigclipmultip, p->sigclipnum);
       gal_statistics_sigma_clip_certain_num(p->sorted, 1, p->size,
                                             p->sigclipmultip, p->sigclipnum,
                                             &ave, &med, &std, 1);
diff --git a/src/imgstat/main.c b/src/imgstat/main.c
index 1493fa7..7419fd5 100644
--- a/src/imgstat/main.c
+++ b/src/imgstat/main.c
@@ -26,11 +26,11 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <stdlib.h>
 #include <progname.h>
 
-#include <gnuastro/timing.h>         /* Includes time.h and sys/time.h */
+#include <gnuastro/timing.h>    /* Includes time.h and sys/time.h */
 
 #include "main.h"
 
-#include "ui.h"                        /* needs main.h.                  */
+#include "ui.h"                 /* needs main.h.                  */
 #include "imgstat.h"            /* needs main.h.                  */
 
 int
diff --git a/src/imgstat/ui.c b/src/imgstat/ui.c
index 36466ee..f929c92 100644
--- a/src/imgstat/ui.c
+++ b/src/imgstat/ui.c
@@ -30,11 +30,11 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <string.h>
 #include <fitsio.h>
 
-#include <nproc.h>              /* From Gnulib.                     */
+#include <nproc.h>               /* From Gnulib.                     */
 
 #include <gnuastro/fits.h>
 #include <gnuastro/qsort.h>
-#include <gnuastro/timing.h>   /* Includes time.h and sys/time.h   */
+#include <gnuastro/timing.h>     /* Includes time.h and sys/time.h   */
 #include <gnuastro/checkset.h>
 #include <gnuastro/txtarray.h>
 #include <gnuastro/arraymanip.h>
@@ -45,8 +45,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* Needs main.h                   */
-#include "args.h"              /* Needs main.h, includes argp.h. */
+#include "ui.h"                  /* Needs main.h                   */
+#include "args.h"                /* Needs main.h, includes argp.h. */
 
 
 /* Set the file names of the places where the default parameters are
@@ -76,7 +76,7 @@ readconfig(char *filename, struct imgstatparams *p)
   char *line, *name, *value;
   struct uiparams *up=&p->up;
   struct gal_commonparams *cp=&p->cp;
-  char key='a';        /* Not used, just a place holder. */
+  char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
      might be intentional, so there is no error. If a parameter is
@@ -93,7 +93,7 @@ readconfig(char *filename, struct imgstatparams *p)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   /* Read the tokens in the file:  */
   while(getline(&line, &len, fp) != -1)
@@ -109,17 +109,18 @@ readconfig(char *filename, struct imgstatparams *p)
         gal_checkset_allocate_copy_set(value, &cp->hdu, &cp->hduset);
 
       else if (strcmp(name, "mask")==0)
-        gal_checkset_allocate_copy_set(value, &up->maskname, &up->masknameset);
+        gal_checkset_allocate_copy_set(value, &up->maskname,
+                                       &up->masknameset);
 
       else if (strcmp(name, "mhdu")==0)
         gal_checkset_allocate_copy_set(value, &up->mhdu, &up->mhduset);
       else if(strcmp(name, "mirrordist")==0)
-       {
-         if(up->mirrordistset) continue;
+        {
+          if(up->mirrordistset) continue;
           gal_checkset_float_l_0(value, &p->mirrordist, name, key, SPACK,
                                  filename, lineno);
           up->mirrordistset=1;
-       }
+        }
 
 
 
@@ -128,104 +129,104 @@ readconfig(char *filename, struct imgstatparams *p)
         gal_checkset_allocate_copy_set(value, &cp->output, &cp->outputset);
 
       else if(strcmp(name, "mirrorplotdist")==0)
-       {
-         if(up->mirrorplotdistset) continue;
-          gal_checkset_float_l_0(value, &p->mirrorplotdist, name, key, SPACK,
-                                 filename, lineno);
+        {
+          if(up->mirrorplotdistset) continue;
+          gal_checkset_float_l_0(value, &p->mirrorplotdist, name, key,
+                                 SPACK, filename, lineno);
           up->mirrorplotdistset=1;
-       }
+        }
       else if(strcmp(name, "onebinvalue")==0)
-       {
-         if(up->onebinvalueset) continue;
+        {
+          if(up->onebinvalueset) continue;
           gal_checkset_any_float(value, &p->onebinvalue, name, key, SPACK,
                                  filename, lineno);
           up->onebinvalueset=1;
-       }
+        }
 
 
       /* Histogram: */
       else if(strcmp(name, "histnumbins")==0)
-       {
-         if(up->histnumbinsset) continue;
-          gal_checkset_sizet_l_zero(value, &p->histnumbins, name, key, SPACK,
-                                    filename, lineno);
+        {
+          if(up->histnumbinsset) continue;
+          gal_checkset_sizet_l_zero(value, &p->histnumbins, name, key,
+                                    SPACK, filename, lineno);
           up->histnumbinsset=1;
-       }
+        }
       else if(strcmp(name, "histmin")==0)
-       {
-         if(up->histminset) continue;
+        {
+          if(up->histminset) continue;
           gal_checkset_any_float(value, &p->histmin, name, key, SPACK,
                                  filename, lineno);
           up->histminset=1;
-       }
+        }
       else if(strcmp(name, "histmax")==0)
-       {
-         if(up->histmaxset) continue;
+        {
+          if(up->histmaxset) continue;
           gal_checkset_any_float(value, &p->histmax, name, key, SPACK,
                                  filename, lineno);
           up->histmaxset=1;
-       }
+        }
       else if(strcmp(name, "histquant")==0)
-       {
-         if(up->histquantset) continue;
-          gal_checkset_float_l_0_s_1(value, &p->histquant, name, key, SPACK,
-                                     filename, lineno);
+        {
+          if(up->histquantset) continue;
+          gal_checkset_float_l_0_s_1(value, &p->histquant, name, key,
+                                     SPACK, filename, lineno);
           up->histquantset=1;
-       }
+        }
 
 
       /* Cumulative Frequency Plot: */
       else if(strcmp(name, "cfpnum")==0)
-       {
-         if(up->cfpnumset) continue;
+        {
+          if(up->cfpnumset) continue;
           gal_checkset_sizet_l_zero(value, &p->cfpnum, name, key, SPACK,
                                     filename, lineno);
           up->cfpnumset=1;
-       }
+        }
       else if(strcmp(name, "cfpmin")==0)
-       {
-         if(up->cfpminset) continue;
+        {
+          if(up->cfpminset) continue;
           gal_checkset_any_float(value, &p->cfpmin, name, key, SPACK,
                                  filename, lineno);
           up->cfpminset=1;
-       }
+        }
       else if(strcmp(name, "cfpmax")==0)
-       {
-         if(up->cfpmaxset) continue;
+        {
+          if(up->cfpmaxset) continue;
           gal_checkset_any_float(value, &p->cfpmax, name, key, SPACK,
                                  filename, lineno);
           up->cfpmaxset=1;
-       }
+        }
       else if(strcmp(name, "cfpquant")==0)
-       {
-         if(up->cfpquantset) continue;
-          gal_checkset_float_l_0_s_1(value, &p->cfpquant, name, key, SPACK,
-                                     filename, lineno);
+        {
+          if(up->cfpquantset) continue;
+          gal_checkset_float_l_0_s_1(value, &p->cfpquant, name, key,
+                                     SPACK, filename, lineno);
           up->cfpquantset=1;
-       }
+        }
 
       /* Sigma clipping: */
       else if(strcmp(name, "sigclipmultip")==0)
-       {
-         if(up->sigclipmultipset) continue;
-          gal_checkset_float_l_0(value, &p->sigclipmultip, name, key, SPACK,
-                                 filename, lineno);
+        {
+          if(up->sigclipmultipset) continue;
+          gal_checkset_float_l_0(value, &p->sigclipmultip, name, key,
+                                 SPACK, filename, lineno);
           up->sigclipmultipset=1;
-       }
+        }
       else if(strcmp(name, "sigcliptolerance")==0)
-       {
-         if(up->sigcliptoleranceset) continue;
-          gal_checkset_float_l_0(value, &p->sigcliptolerance, name, key, SPACK,
-                                 filename, lineno);
+        {
+          if(up->sigcliptoleranceset) continue;
+          gal_checkset_float_l_0(value, &p->sigcliptolerance, name, key,
+                                 SPACK, filename, lineno);
           up->sigcliptoleranceset=1;
-       }
+        }
       else if(strcmp(name, "sigclipnum")==0)
-       {
-         if(up->sigclipnumset) continue;
-          gal_checkset_sizet_l_zero(value, &p->sigclipnum, name, key, SPACK,
-                                    filename, lineno);
+        {
+          if(up->sigclipnumset) continue;
+          gal_checkset_sizet_l_zero(value, &p->sigclipnum, name, key,
+                                    SPACK, filename, lineno);
           up->sigclipnumset=1;
-       }
+        }
 
 
       /* Operating modes: */
@@ -234,8 +235,8 @@ readconfig(char *filename, struct imgstatparams *p)
 
 
       else
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     "`%s` not recognized.\n", name);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      "`%s` not recognized.\n", name);
     }
 
   free(line);
@@ -391,17 +392,19 @@ sanitycheck(struct imgstatparams *p)
   if(p->histname)
     {
       p->histname=NULL;         /* It wasn't allocated. */
-      gal_checkset_automatic_output(basename, "_hist.txt", p->cp.removedirinfo,
+      gal_checkset_automatic_output(basename, "_hist.txt",
+                                    p->cp.removedirinfo,
                                     p->cp.dontdelete, &p->histname);
     }
   if(p->cfpname)
     {
       p->cfpname=NULL;         /* It wasn't allocated. */
-      gal_checkset_automatic_output(basename, "_cfp.txt", p->cp.removedirinfo,
+      gal_checkset_automatic_output(basename, "_cfp.txt",
+                                    p->cp.removedirinfo,
                                     p->cp.dontdelete, &p->cfpname);
     }
-  if(p->mhistname)              /* The mode mirror distribution will need */
-    {                           /* both a histogram and cfp.              */
+  if(p->mhistname)             /* The mode mirror distribution will need */
+    {                          /* both a histogram and cfp.              */
       p->mcfpname=p->mhistname=NULL;
       gal_checkset_automatic_output(basename, "_modehist.txt",
                                     p->cp.removedirinfo, p->cp.dontdelete,
@@ -427,11 +430,11 @@ sanitycheck(struct imgstatparams *p)
   if(p->cfpname && p->histname==NULL)
     {
       if(p->cfpsimhist)
-       error(EXIT_FAILURE, 0, "without a histogram, `--cfpsimhist` is "
+        error(EXIT_FAILURE, 0, "without a histogram, `--cfpsimhist` is "
               "meaningless");
       if (p->maxcfpeqmaxhist)
-       error(EXIT_FAILURE, 0, "without a histogram, `--maxcfpeqmaxhist` "
-               "is meaningless");
+        error(EXIT_FAILURE, 0, "without a histogram, `--maxcfpeqmaxhist` "
+              "is meaningless");
     }
 
   /* Check if `--maxcfpeqmaxhist` and `--normcfp` are not called
@@ -443,7 +446,7 @@ sanitycheck(struct imgstatparams *p)
   /* Check if `normhist` and `maxhistone` are not called together: */
   if(p->normhist && p->maxhistone)
     error(EXIT_FAILURE, 0, "`--normhist` and `--histnumbins` cannot be "
-             "called together\n");
+          "called together\n");
 }
 
 
diff --git a/src/imgwarp/args.h b/src/imgwarp/args.h
index 28d11f8..bb85382 100644
--- a/src/imgwarp/args.h
+++ b/src/imgwarp/args.h
@@ -188,9 +188,9 @@ parse_opt(int key, char *arg, struct argp_state *state)
      user is warned and the program is stopped: */
   if(arg && arg[0]=='=')
     argp_error(state, "incorrect use of the equal sign (`=`). For short "
-              "options, `=` should not be used and for long options, "
-              "there should be no space between the option, equal sign "
-              "and value");
+               "options, `=` should not be used and for long options, "
+               "there should be no space between the option, equal sign "
+               "and value");
 
   switch(key)
     {
@@ -241,15 +241,15 @@ parse_opt(int key, char *arg, struct argp_state *state)
             argp_error(state, "only one input image should be given");
           else
             p->up.inputname=arg;
-       }
+        }
       else
-       {
-         if(p->up.matrixname)
-           argp_error(state, "only one warp/transformation matrix "
+        {
+          if(p->up.matrixname)
+            argp_error(state, "only one warp/transformation matrix "
                        "should be given");
-         else
+          else
             p->up.matrixname=arg;
-       }
+        }
       break;
 
 
@@ -259,13 +259,13 @@ parse_opt(int key, char *arg, struct argp_state *state)
     /* The command line options and arguments are finished. */
     case ARGP_KEY_END:
       if(p->cp.setdirconf==0 && p->cp.setusrconf==0
-        && p->cp.printparams==0)
-       {
-         if(state->arg_num==0)
-           argp_error(state, "no argument given");
-         if(p->up.inputname==NULL)
-           argp_error(state, "no input FITS image(s) provided");
-       }
+         && p->cp.printparams==0)
+        {
+          if(state->arg_num==0)
+            argp_error(state, "no argument given");
+          if(p->up.inputname==NULL)
+            argp_error(state, "no input FITS image(s) provided");
+        }
       break;
 
 
@@ -295,6 +295,6 @@ struct argp_child children[]=
 
 /* Basic structure defining the whole argument reading process. */
 static struct argp thisargp = {options, parse_opt, args_doc,
-                              doc, children, NULL, NULL};
+                               doc, children, NULL, NULL};
 
 #endif
diff --git a/src/imgwarp/cite.h b/src/imgwarp/cite.h
index c589224..8a88e17 100644
--- a/src/imgwarp/cite.h
+++ b/src/imgwarp/cite.h
@@ -25,14 +25,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #define IMGWARPBIBTEX ""
 
-#define PRINTCITEABORT {                                               \
-    printf("\nWe hope %s has been useful for your research.\n"         \
-          "Citations are vital for the continued work on %s.\n"        \
-          "Thank you for citing it in your research paper.\n"          \
-          "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
-          SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
-           GAL_STRINGS_MAIN_BIBTEX, IMGWARPBIBTEX);                    \
-    exit(EXIT_SUCCESS);                                                        
\
+#define PRINTCITEABORT {                                                \
+    printf("\nWe hope %s has been useful for your research.\n"          \
+           "Citations are vital for the continued work on %s.\n"        \
+           "Thank you for citing it in your research paper.\n"          \
+           "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
+           SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
+           GAL_STRINGS_MAIN_BIBTEX, IMGWARPBIBTEX);                     \
+    exit(EXIT_SUCCESS);                                                 \
 }
 
 #endif
diff --git a/src/imgwarp/imgwarp.c b/src/imgwarp/imgwarp.c
index ad421d7..62624af 100644
--- a/src/imgwarp/imgwarp.c
+++ b/src/imgwarp/imgwarp.c
@@ -66,7 +66,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
    nearestint_halfhigher(0.5f) --> 1.0f
 */
 #define nearestint_halfhigher(D)                                        \
-  (ceil((D)) - (D) > 0.5f + GAL_POLYGON_ROUND_ERR ? ceil((D))-1.0f : ceil((D)))
+  (ceil((D)) - (D) > 0.5f                                               \
+   + GAL_POLYGON_ROUND_ERR ? ceil((D))-1.0f : ceil((D)))
 
 
 
@@ -161,10 +162,12 @@ imgwarponthread(void *inparam)
       /* For a check:
       if(ind==9999)
         {
-          printf("\n\n\nind: %lu: (%lu, %lu):\n", ind, ind%os1+1, ind/os1+1);
+          printf("\n\n\nind: %lu: (%lu, %lu):\n",
+                 ind, ind%os1+1, ind/os1+1);
           for(j=0;j<4;++j)
             printf("(%.3f, %.3f) --> (%.3f, %.3f)\n",
-                   ocrn[j*2], ocrn[j*2+1], icrn_base[j*2], icrn_base[j*2+1]);
+                   ocrn[j*2], ocrn[j*2+1], icrn_base[j*2],
+                   icrn_base[j*2+1]);
           printf("------- Ordered -------\n");
           for(j=0;j<4;++j) printf("(%.3f, %.3f)\n", icrn[j*2], icrn[j*2+1]);
           printf("------- Start and ending pixels -------\n");
@@ -230,7 +233,8 @@ imgwarponthread(void *inparam)
 
               /* For a simple pixel value check:
               if(ind==97387)
-                printf("%f --> (%lu) %f\n", v*gal_polygon_area(ccrn, numcrn),
+                printf("%f --> (%lu) %f\n",
+                       v*gal_polygon_area(ccrn, numcrn),
                        numinput, output[ind]);
               */
             }
@@ -455,7 +459,7 @@ correctwcssaveoutput(struct imgwarpparams *p)
   if(p->inputbitpix==DOUBLE_IMG || p->doubletype)
     {
       array=p->output;
-      p->inputbitpix=DOUBLE_IMG; /* In case it wasn't and p->doubletype==1 */
+      p->inputbitpix=DOUBLE_IMG; /* Not converted and p->doubletype==1 */
     }
   else
     gal_fits_change_type((void **)p->output, DOUBLE_IMG,
@@ -468,9 +472,9 @@ correctwcssaveoutput(struct imgwarpparams *p)
     {
       sprintf(&keyword[i*FLEN_KEYWORD], "WMTX%lu_%lu", i/3+1, i%3+1);
       gal_fits_add_to_fits_header_ll_end(&headers, TDOUBLE,
-                                              &keyword[i*FLEN_KEYWORD], 0,
-                                              &p->matrix[i], 0, "Warp matrix "
-                                              "element value.", 0, NULL);
+                                         &keyword[i*FLEN_KEYWORD], 0,
+                                         &p->matrix[i], 0, "Warp matrix "
+                                         "element value.", 0, NULL);
     }
 
   /* Save the output: */
@@ -545,9 +549,9 @@ imgwarp(struct imgwarpparams *p)
   else
     {
       /* Initialize the attributes. Note that this running thread
-        (that spinns off the nt threads) is also a thread, so the
-        number the barrier should be one more than the number of
-        threads spinned off. */
+         (that spinns off the nt threads) is also a thread, so the
+         number the barrier should be one more than the number of
+         threads spinned off. */
       if(size<nt) nb=size+1;
       else nb=nt+1;
       gal_threads_attr_barrier_init(&attr, &b, nb);
@@ -559,9 +563,9 @@ imgwarp(struct imgwarpparams *p)
             iwp[i].p=p;
             iwp[i].b=&b;
             iwp[i].indexs=&indexs[i*thrdcols];
-           err=pthread_create(&t, &attr, imgwarponthread, &iwp[i]);
-           if(err)
-             error(EXIT_FAILURE, 0, "can't create thread %lu", i);
+            err=pthread_create(&t, &attr, imgwarponthread, &iwp[i]);
+            if(err)
+              error(EXIT_FAILURE, 0, "can't create thread %lu", i);
           }
 
       /* Wait for all threads to finish and free the spaces. */
diff --git a/src/imgwarp/ui.c b/src/imgwarp/ui.c
index 41adc4a..908cab1 100644
--- a/src/imgwarp/ui.c
+++ b/src/imgwarp/ui.c
@@ -29,10 +29,10 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <string.h>
 #include <fitsio.h>
 
-#include <nproc.h>              /* From Gnulib.                     */
+#include <nproc.h>               /* From Gnulib.                   */
 
 #include <gnuastro/fits.h>
-#include <gnuastro/timing.h>           /* Includes time.h and sys/time.h   */
+#include <gnuastro/timing.h>     /* Includes time.h and sys/time.h */
 #include <gnuastro/checkset.h>
 #include <gnuastro/txtarray.h>
 #include <gnuastro/commonargs.h>
@@ -40,8 +40,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* Needs main.h                   */
-#include "args.h"              /* Needs main.h, includes argp.h. */
+#include "ui.h"                  /* Needs main.h                   */
+#include "args.h"                /* Needs main.h, includes argp.h. */
 
 
 /* Set the file names of the places where the default parameters are
@@ -71,7 +71,7 @@ readconfig(char *filename, struct imgwarpparams *p)
   char *line, *name, *value;
   struct uiparams *up=&p->up;
   struct gal_commonparams *cp=&p->cp;
-  char key='a';        /* Not used, just a place holder. */
+  char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
      might be intentional, so there is no error. If a parameter is
@@ -88,7 +88,7 @@ readconfig(char *filename, struct imgwarpparams *p)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   /* Read the tokens in the file:  */
   while(getline(&line, &len, fp) != -1)
@@ -103,19 +103,19 @@ readconfig(char *filename, struct imgwarpparams *p)
       if(strcmp(name, "hdu")==0)
         gal_checkset_allocate_copy_set(value, &cp->hdu, &cp->hduset);
       else if(strcmp(name, "hstartwcs")==0)
-       {
-         if(up->hstartwcsset) continue;
-         gal_checkset_sizet_el_zero(value, &p->hstartwcs, name, key, SPACK,
-                                     filename, lineno);
-         up->hstartwcsset=1;
-       }
+        {
+          if(up->hstartwcsset) continue;
+          gal_checkset_sizet_el_zero(value, &p->hstartwcs, name, key,
+                                     SPACK, filename, lineno);
+          up->hstartwcsset=1;
+        }
       else if(strcmp(name, "hendwcs")==0)
-       {
-         if(up->hendwcsset) continue;
-         gal_checkset_sizet_el_zero(value, &p->hendwcs, name, key, SPACK,
+        {
+          if(up->hendwcsset) continue;
+          gal_checkset_sizet_el_zero(value, &p->hendwcs, name, key, SPACK,
                                      filename, lineno);
-         up->hendwcsset=1;
-       }
+          up->hendwcsset=1;
+        }
 
 
 
@@ -131,10 +131,10 @@ readconfig(char *filename, struct imgwarpparams *p)
 
       else if(strcmp(name, "maxblankfrac")==0)
         {
-         if(up->maxblankfracset) continue;
-         gal_checkset_float_l_0_s_1(value, &p->maxblankfrac, name, key, SPACK,
-                                     filename, lineno);
-         up->maxblankfracset=1;
+          if(up->maxblankfracset) continue;
+          gal_checkset_float_l_0_s_1(value, &p->maxblankfrac, name, key,
+                                     SPACK, filename, lineno);
+          up->maxblankfracset=1;
         }
 
 
@@ -146,8 +146,8 @@ readconfig(char *filename, struct imgwarpparams *p)
 
 
       else
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     "`%s` not recognized.\n", name);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      "`%s` not recognized.\n", name);
     }
 
   free(line);
diff --git a/src/mkcatalog/args.h b/src/mkcatalog/args.h
index 21fd6ba..5b1c8ca 100644
--- a/src/mkcatalog/args.h
+++ b/src/mkcatalog/args.h
@@ -596,9 +596,9 @@ parse_opt(int key, char *arg, struct argp_state *state)
      user is warned and the program is stopped: */
   if(arg && arg[0]=='=')
     argp_error(state, "incorrect use of the equal sign (`=`). For short "
-              "options, `=` should not be used and for long options, "
-              "there should be no space between the option, equal sign "
-              "and value");
+               "options, `=` should not be used and for long options, "
+               "there should be no space between the option, equal sign "
+               "and value");
 
   switch(key)
     {
@@ -855,7 +855,7 @@ parse_opt(int key, char *arg, struct argp_state *state)
             argp_error(state, "only one input image should be given");
           else
             p->up.inputname=arg;
-       }
+        }
       else
         argp_error(state, "%s is not a valid file type", arg);
       break;
@@ -867,13 +867,13 @@ parse_opt(int key, char *arg, struct argp_state *state)
     /* The command line options and arguments are finished. */
     case ARGP_KEY_END:
       if(p->cp.setdirconf==0 && p->cp.setusrconf==0
-        && p->cp.printparams==0)
-       {
-         if(state->arg_num==0)
-           argp_error(state, "no argument given");
-         if(p->up.inputname==NULL)
-           argp_error(state, "no input FITS image(s) provided");
-       }
+         && p->cp.printparams==0)
+        {
+          if(state->arg_num==0)
+            argp_error(state, "no argument given");
+          if(p->up.inputname==NULL)
+            argp_error(state, "no input FITS image(s) provided");
+        }
       break;
 
 
@@ -903,6 +903,6 @@ struct argp_child children[]=
 
 /* Basic structure defining the whole argument reading process. */
 static struct argp thisargp = {options, parse_opt, args_doc,
-                              doc, children, NULL, NULL};
+                               doc, children, NULL, NULL};
 
 #endif
diff --git a/src/mkcatalog/cite.h b/src/mkcatalog/cite.h
index c2b6377..5b5c609 100644
--- a/src/mkcatalog/cite.h
+++ b/src/mkcatalog/cite.h
@@ -25,14 +25,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #define MKCATALOGBIBTEX ""
 
-#define PRINTCITEABORT {                                               \
-    printf("\nWe hope %s has been useful for your research.\n"         \
-          "Citations are vital for the continued work on %s.\n"        \
-          "Thank you for citing it in your research paper.\n"          \
-          "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
-          SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
-           GAL_STRINGS_MAIN_BIBTEX, MKCATALOGBIBTEX);                  \
-    exit(EXIT_SUCCESS);                                                        
\
+#define PRINTCITEABORT {                                                \
+    printf("\nWe hope %s has been useful for your research.\n"          \
+           "Citations are vital for the continued work on %s.\n"        \
+           "Thank you for citing it in your research paper.\n"          \
+           "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
+           SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
+           GAL_STRINGS_MAIN_BIBTEX, MKCATALOGBIBTEX);                   \
+    exit(EXIT_SUCCESS);                                                 \
 }
 
 #endif
diff --git a/src/mkcatalog/main.c b/src/mkcatalog/main.c
index 85fce90..d2bba10 100644
--- a/src/mkcatalog/main.c
+++ b/src/mkcatalog/main.c
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* needs main.h.                  */
+#include "ui.h"                 /* needs main.h.                  */
 #include "mkcatalog.h"          /* needs main.h.                  */
 
 int
diff --git a/src/mkcatalog/ui.c b/src/mkcatalog/ui.c
index 3af473e..374b09d 100644
--- a/src/mkcatalog/ui.c
+++ b/src/mkcatalog/ui.c
@@ -30,10 +30,10 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <string.h>
 #include <fitsio.h>
 
-#include <nproc.h>              /* From Gnulib.                     */
+#include <nproc.h>               /* From Gnulib.                   */
 
 #include <gnuastro/fits.h>
-#include <gnuastro/timing.h>    /* Includes time.h and sys/time.h   */
+#include <gnuastro/timing.h>     /* Includes time.h and sys/time.h */
 #include <gnuastro/checkset.h>
 #include <gnuastro/txtarray.h>
 #include <gnuastro/commonargs.h>
@@ -41,8 +41,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* Needs main.h                   */
-#include "args.h"              /* Needs main.h, includes argp.h. */
+#include "ui.h"                  /* Needs main.h                   */
+#include "args.h"                /* Needs main.h, includes argp.h. */
 
 
 /* Set the file names of the places where the default parameters are
@@ -73,7 +73,7 @@ readconfig(char *filename, struct mkcatalogparams *p)
   char *line, *name, *value;
   struct uiparams *up=&p->up;
   struct gal_commonparams *cp=&p->cp;
-  char key='a';        /* Not used, just a place holder. */
+  char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
      might be intentional, so there is no error. If a parameter is
@@ -90,7 +90,7 @@ readconfig(char *filename, struct mkcatalogparams *p)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   /* Read the tokens in the file:  */
   while(getline(&line, &len, fp) != -1)
@@ -105,27 +105,34 @@ readconfig(char *filename, struct mkcatalogparams *p)
       if(strcmp(name, "hdu")==0)
         gal_checkset_allocate_copy_set(value, &cp->hdu, &cp->hduset);
       else if (strcmp(name, "mask")==0)
-        gal_checkset_allocate_copy_set(value, &up->maskname, &up->masknameset);
+        gal_checkset_allocate_copy_set(value, &up->maskname,
+                                       &up->masknameset);
       else if (strcmp(name, "mhdu")==0)
         gal_checkset_allocate_copy_set(value, &up->mhdu, &up->mhduset);
       else if (strcmp(name, "objlabs")==0)
         gal_checkset_allocate_copy_set(value, &up->objlabsname,
                                        &up->objlabsnameset);
       else if (strcmp(name, "objhdu")==0)
-        gal_checkset_allocate_copy_set(value, &up->objhdu, &up->objhduset);
+        gal_checkset_allocate_copy_set(value, &up->objhdu,
+                                       &up->objhduset);
       else if (strcmp(name, "clumplabs")==0)
         gal_checkset_allocate_copy_set(value, &up->clumplabsname,
                                        &up->clumplabsnameset);
       else if (strcmp(name, "clumphdu")==0)
-        gal_checkset_allocate_copy_set(value, &up->clumphdu, &up->clumphduset);
+        gal_checkset_allocate_copy_set(value, &up->clumphdu,
+                                       &up->clumphduset);
       else if (strcmp(name, "skyfilename")==0)
-        gal_checkset_allocate_copy_set(value, &up->skyname, &up->skynameset);
+        gal_checkset_allocate_copy_set(value, &up->skyname,
+                                       &up->skynameset);
       else if (strcmp(name, "skyhdu")==0)
-        gal_checkset_allocate_copy_set(value, &up->skyhdu, &up->skyhduset);
+        gal_checkset_allocate_copy_set(value, &up->skyhdu,
+                                       &up->skyhduset);
       else if (strcmp(name, "stdfilename")==0)
-        gal_checkset_allocate_copy_set(value, &up->stdname, &up->stdnameset);
+        gal_checkset_allocate_copy_set(value, &up->stdname,
+                                       &up->stdnameset);
       else if (strcmp(name, "stdhdu")==0)
-        gal_checkset_allocate_copy_set(value, &up->stdhdu, &up->stdhduset);
+        gal_checkset_allocate_copy_set(value, &up->stdhdu,
+                                       &up->stdhduset);
       else if (strcmp(name, "zeropoint")==0)
         {
           if(up->zeropointset) continue;
@@ -136,22 +143,23 @@ readconfig(char *filename, struct mkcatalogparams *p)
       else if (strcmp(name, "skysubtracted")==0)
         {
           if(up->skysubtractedset) continue;
-          gal_checkset_int_zero_or_one(value, &p->skysubtracted, name, key,
-                                       SPACK, filename, lineno);
+          gal_checkset_int_zero_or_one(value, &p->skysubtracted, name,
+                                       key, SPACK, filename, lineno);
           up->skysubtractedset=1;
         }
       else if(strcmp(name, "threshold")==0)
         {
           if(up->thresholdset) continue;
-          gal_checkset_any_double(value, &p->threshold, name, key, SPACK,
-                   filename, lineno);
+          gal_checkset_any_double(value, &p->threshold, name, key,
+                                  SPACK, filename, lineno);
           up->thresholdset=1;
         }
 
 
       /* Outputs */
       else if(strcmp(name, "output")==0)
-        gal_checkset_allocate_copy_set(value, &cp->output, &cp->outputset);
+        gal_checkset_allocate_copy_set(value, &cp->output,
+                                       &cp->outputset);
       else if(strcmp(name, "nsigmag")==0)
         {
           if(up->nsigmagset) continue;
@@ -169,29 +177,29 @@ readconfig(char *filename, struct mkcatalogparams *p)
       else if(strcmp(name, "floatwidth")==0)
         {
           if(up->floatwidthset) continue;
-          gal_checkset_int_l_zero(value, &p->floatwidth, name, key, SPACK,
-                                  filename, lineno);
+          gal_checkset_int_l_zero(value, &p->floatwidth, name, key,
+                                  SPACK, filename, lineno);
           up->floatwidthset=1;
         }
       else if(strcmp(name, "accuwidth")==0)
         {
           if(up->accuwidthset) continue;
-          gal_checkset_int_l_zero(value, &p->accuwidth, name, key, SPACK,
-                                  filename, lineno);
+          gal_checkset_int_l_zero(value, &p->accuwidth, name, key,
+                                  SPACK, filename, lineno);
           up->accuwidthset=1;
         }
       else if(strcmp(name, "floatprecision")==0)
         {
           if(up->floatprecisionset) continue;
-          gal_checkset_int_l_zero(value, &p->floatprecision, name, key, SPACK,
-                                  filename, lineno);
+          gal_checkset_int_l_zero(value, &p->floatprecision, name,
+                                  key, SPACK, filename, lineno);
           up->floatprecisionset=1;
         }
       else if(strcmp(name, "accuprecision")==0)
         {
           if(up->accuprecisionset) continue;
-          gal_checkset_int_l_zero(value, &p->accuprecision, name, key, SPACK,
-                                  filename, lineno);
+          gal_checkset_int_l_zero(value, &p->accuprecision, name,
+                                  key, SPACK, filename, lineno);
           up->accuprecisionset=1;
         }
 
@@ -548,8 +556,8 @@ readconfig(char *filename, struct mkcatalogparams *p)
 
 
       else
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     "`%s` not recognized.\n", name);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      "`%s` not recognized.\n", name);
     }
 
   free(line);
@@ -578,19 +586,24 @@ printvalues(FILE *fp, struct mkcatalogparams *p)
   if(up->mhduset)
     GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("mhdu", up->mhdu);
   if(up->objlabsnameset)
-    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("objlabs", up->objlabsname);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("objlabs",
+                                               up->objlabsname);
   if(up->objhduset)
     GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("objhdu", up->objhdu);
   if(up->clumplabsnameset)
-    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("clumplabs", up->clumplabsname);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("clumplabs",
+                                               up->clumplabsname);
   if(up->clumphduset)
-    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("clumphdu", up->clumphdu);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("clumphdu",
+                                               up->clumphdu);
   if(up->skynameset)
-    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("skyfilename", up->skyname);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("skyfilename",
+                                               up->skyname);
   if(up->skyhduset)
     GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("skyhdu", up->skyhdu);
   if(up->stdnameset)
-    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("stdfilename", up->stdname);
+    GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("stdfilename",
+                                               up->stdname);
   if(up->stdhduset)
     GAL_CHECKSET_PRINT_STRING_MAYBE_WITH_SPACE("stdhdu", up->stdhdu);
   if(up->zeropointset)
@@ -830,22 +843,22 @@ sanitycheck(struct mkcatalogparams *p)
 
   /* Set the names of the files. */
   gal_fits_file_or_ext_name(p->up.inputname, p->cp.hdu, p->up.masknameset,
-                                 &p->up.maskname, p->up.mhdu, p->up.mhduset,
-                                 "mask");
+                            &p->up.maskname, p->up.mhdu, p->up.mhduset,
+                            "mask");
   gal_fits_file_or_ext_name(p->up.inputname, p->cp.hdu,
-                                 p->up.objlabsnameset, &p->up.objlabsname,
-                                 p->up.objhdu, p->up.objhduset,
-                                 "object labels");
+                            p->up.objlabsnameset, &p->up.objlabsname,
+                            p->up.objhdu, p->up.objhduset,
+                            "object labels");
   gal_fits_file_or_ext_name(p->up.inputname, p->cp.hdu,
-                                 p->up.clumplabsnameset, &p->up.clumplabsname,
-                                 p->up.clumphdu, p->up.clumphduset,
-                                 "clump labels");
+                            p->up.clumplabsnameset, &p->up.clumplabsname,
+                            p->up.clumphdu, p->up.clumphduset,
+                            "clump labels");
   gal_fits_file_or_ext_name(p->up.inputname, p->cp.hdu, p->up.skynameset,
-                                 &p->up.skyname, p->up.skyhdu, p->up.skyhduset,
-                                 "sky value image");
+                            &p->up.skyname, p->up.skyhdu, p->up.skyhduset,
+                            "sky value image");
   gal_fits_file_or_ext_name(p->up.inputname, p->cp.hdu, p->up.stdnameset,
-                                 &p->up.stdname, p->up.stdhdu, p->up.stdhduset,
-                                 "sky standard deviation");
+                            &p->up.stdname, p->up.stdhdu, p->up.stdhduset,
+                            "sky standard deviation");
 
   /* Read the number of labels for the objects:  */
   keys[0].keyname="DETSN";        keys[0].datatype=TDOUBLE;
@@ -883,8 +896,8 @@ sanitycheck(struct mkcatalogparams *p)
       if( OFlxWhtX!=OFlxWhtY-1 || OFlxWhtRA!=OFlxWhtDec-1 )
         error(EXIT_FAILURE, 0, "a bug! Please contact us at %s so we can "
               "fix the problem. X(%d) and Y(%d), or Ra(%d) and Dec(%d) "
-              "columns in the information array are not immediately after "
-              "each other", PACKAGE_BUGREPORT, OFlxWhtX, OFlxWhtY,
+              "columns in the information array are not immediately "
+              "after each other", PACKAGE_BUGREPORT, OFlxWhtX, OFlxWhtY,
               OFlxWhtRA, OFlxWhtDec);
     }
 
@@ -970,8 +983,8 @@ checksetfloat(struct mkcatalogparams *p, char *filename, 
char *hdu,
   /* Make sure it has no blank pixels. */
   if(anyblank)
     error(EXIT_FAILURE, 0, "the Sky and Sky standard deviation images "
-          "should not have any blank values. %s (hdu: %s) has blank pixels",
-          filename, hdu);
+          "should not have any blank values. %s (hdu: %s) has blank "
+          "pixels", filename, hdu);
 
   /* Make sure it has the same size as the image. */
   if(s0!=p->s0 || s1!=p->s1)
@@ -1151,10 +1164,11 @@ preparearrays(struct mkcatalogparams *p)
           p->clumpcols[p->clumpncols++] = p->allcols[i];
           break;
         default:
-          error(EXIT_FAILURE, 0, "a bug! Please contact us at %s so we can "
-                "fix the problem. For some reason p->allcols[%lu] is given "
-                "the value %lu which is not recognized in preparearrays "
-                "(ui.c)", PACKAGE_BUGREPORT, i, p->allcols[i]);
+          error(EXIT_FAILURE, 0, "a bug! Please contact us at %s so we "
+                "can fix the problem. For some reason p->allcols[%lu] "
+                "is given the value %lu which is not recognized in "
+                "preparearrays (ui.c)", PACKAGE_BUGREPORT, i,
+                p->allcols[i]);
         }
     }
 
@@ -1167,7 +1181,8 @@ preparearrays(struct mkcatalogparams *p)
       gal_fits_file_to_float(p->up.inputname, p->up.maskname, p->cp.hdu,
                                   p->up.mhdu, &p->img, &bitpix, &anyblank,
                                   &p->s0, &p->s1);
-      gal_fits_read_wcs(p->up.inputname, p->cp.hdu, 0, 0, &p->nwcs, &p->wcs);
+      gal_fits_read_wcs(p->up.inputname, p->cp.hdu, 0, 0, &p->nwcs,
+                        &p->wcs);
 
 
       /* Read and check the other arrays: */
@@ -1191,7 +1206,8 @@ preparearrays(struct mkcatalogparams *p)
       if(p->clumpncols>0 && p->numclumps>0)
         {
           errno=0;
-          p->clumpcat=malloc(p->clumpncols*p->numclumps*sizeof *p->clumpcat);
+          p->clumpcat=malloc(p->clumpncols*p->numclumps
+                             * sizeof *p->clumpcat);
           if(p->clumpcat==NULL)
             error(EXIT_FAILURE, errno, "%lu bytes for p->clumpcat in "
                   "preprarearrays (ui.c)",
diff --git a/src/mknoise/args.h b/src/mknoise/args.h
index 2d1ec21..9b492c5 100644
--- a/src/mknoise/args.h
+++ b/src/mknoise/args.h
@@ -169,9 +169,9 @@ parse_opt(int key, char *arg, struct argp_state *state)
      user is warned and the program is stopped: */
   if(arg && arg[0]=='=')
     argp_error(state, "incorrect use of the equal sign (`=`). For short "
-              "options, `=` should not be used and for long options, "
-              "there should be no space between the option, equal sign "
-              "and value");
+               "options, `=` should not be used and for long options, "
+               "there should be no space between the option, equal sign "
+               "and value");
 
   switch(key)
     {
@@ -214,7 +214,7 @@ parse_opt(int key, char *arg, struct argp_state *state)
             argp_error(state, "only one input image should be given");
           else
             p->up.inputname=arg;
-       }
+        }
       else
         argp_error(state, "%s is not a valid file type", arg);
       break;
@@ -226,13 +226,13 @@ parse_opt(int key, char *arg, struct argp_state *state)
     /* The command line options and arguments are finished. */
     case ARGP_KEY_END:
       if(p->cp.setdirconf==0 && p->cp.setusrconf==0
-        && p->cp.printparams==0)
-       {
-         if(state->arg_num==0)
-           argp_error(state, "no argument given");
-         if(p->up.inputname==NULL)
-           argp_error(state, "no input FITS image(s) provided");
-       }
+         && p->cp.printparams==0)
+        {
+          if(state->arg_num==0)
+            argp_error(state, "no argument given");
+          if(p->up.inputname==NULL)
+            argp_error(state, "no input FITS image(s) provided");
+        }
       break;
 
 
@@ -262,6 +262,6 @@ struct argp_child children[]=
 
 /* Basic structure defining the whole argument reading process. */
 static struct argp thisargp = {options, parse_opt, args_doc,
-                              doc, children, NULL, NULL};
+                               doc, children, NULL, NULL};
 
 #endif
diff --git a/src/mknoise/cite.h b/src/mknoise/cite.h
index 78ef494..b72eda7 100644
--- a/src/mknoise/cite.h
+++ b/src/mknoise/cite.h
@@ -25,14 +25,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #define MKNOISEBIBTEX ""
 
-#define PRINTCITEABORT {                                               \
-    printf("\nWe hope %s has been useful for your research.\n"         \
-          "Citations are vital for the continued work on %s.\n"        \
-          "Thank you for citing it in your research paper.\n"          \
-          "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
-          SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
-           GAL_STRINGS_MAIN_BIBTEX, MKNOISEBIBTEX);                    \
-    exit(EXIT_SUCCESS);                                                        
\
+#define PRINTCITEABORT {                                                \
+    printf("\nWe hope %s has been useful for your research.\n"          \
+           "Citations are vital for the continued work on %s.\n"        \
+           "Thank you for citing it in your research paper.\n"          \
+           "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
+           SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
+           GAL_STRINGS_MAIN_BIBTEX, MKNOISEBIBTEX);                     \
+    exit(EXIT_SUCCESS);                                                 \
 }
 
 #endif
diff --git a/src/mknoise/main.c b/src/mknoise/main.c
index 736f488..74b8b47 100644
--- a/src/mknoise/main.c
+++ b/src/mknoise/main.c
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* needs main.h.                  */
+#include "ui.h"                 /* needs main.h.                  */
 #include "mknoise.h"            /* needs main.h.                  */
 
 int
diff --git a/src/mknoise/mknoise.c b/src/mknoise/mknoise.c
index 83e6dec..830f94c 100644
--- a/src/mknoise/mknoise.c
+++ b/src/mknoise/mknoise.c
@@ -28,9 +28,9 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <error.h>
 #include <string.h>
 #include <stdlib.h>
-#include <sys/time.h>           /* Generate random seed. */
-#include <gsl/gsl_rng.h>        /* Used in setrandoms.   */
-#include <gsl/gsl_randist.h>    /* To make noise.        */
+#include <sys/time.h>            /* Generate random seed. */
+#include <gsl/gsl_rng.h>         /* Used in setrandoms.   */
+#include <gsl/gsl_randist.h>     /* To make noise.        */
 
 #include <gnuastro/timing.h>
 #include <gnuastro/fits.h>
@@ -54,15 +54,16 @@ void
 convertsaveoutput(struct mknoiseparams *p)
 {
   void *array;
+  char keyname1[FLEN_KEYWORD];
   struct gal_fits_header_ll *headers=NULL;
-  char keyname1[FLEN_KEYWORD], keyname2[FLEN_KEYWORD];
-  char keyname3[FLEN_KEYWORD], keyname4[FLEN_KEYWORD], keyname5[FLEN_KEYWORD];
+  char keyname2[FLEN_KEYWORD], keyname3[FLEN_KEYWORD];
+  char keyname4[FLEN_KEYWORD], keyname5[FLEN_KEYWORD];
 
   /* Convert the output to the input image format: */
   if(p->inputbitpix==DOUBLE_IMG || p->doubletype)
     {
       array=p->input;
-      p->inputbitpix=DOUBLE_IMG; /* In case it wasn't and p->doubletype==1 */
+      p->inputbitpix=DOUBLE_IMG; /* Not converted and p->doubletype==1 */
     }
   else
     gal_fits_change_type((void **)p->input, DOUBLE_IMG, p->is0*p->is1,
@@ -72,25 +73,25 @@ convertsaveoutput(struct mknoiseparams *p)
   gal_fits_file_name_in_keywords("INF", p->up.inputname, &headers);
   strcpy(keyname1, "BCKGRND");
   gal_fits_add_to_fits_header_ll_end(&headers, TDOUBLE, keyname1, 0,
-                                          &p->mbackground, 0, "Background "
-                                          "value (in magnitude) for noise.",
-                                          0, NULL);
+                                     &p->mbackground, 0, "Background "
+                                     "value (in magnitude) for noise.",
+                                     0, NULL);
   strcpy(keyname2, "BZRPNT");
   gal_fits_add_to_fits_header_ll_end(&headers, TDOUBLE, keyname2, 0,
-                                          &p->zeropoint, 0, "Zeropoint "
-                                          "magnitude of image.", 0, NULL);
+                                     &p->zeropoint, 0, "Zeropoint "
+                                     "magnitude of image.", 0, NULL);
   strcpy(keyname3, "STDADD");
   gal_fits_add_to_fits_header_ll_end(&headers, TDOUBLE, keyname3, 0,
-                                          &p->stdadd, 0, "Instrumental noise "
-                                          "in units of flux.", 0, NULL);
+                                     &p->stdadd, 0, "Instrumental noise "
+                                     "in units of flux.", 0, NULL);
   strcpy(keyname4, "RNGTYPE");
   gal_fits_add_to_fits_header_ll_end(&headers, TSTRING, keyname4, 0,
-                                          &p->rng_type, 0, "Random number "
-                                          "generator (by GSL) type.", 0, NULL);
+                                     &p->rng_type, 0, "Random number "
+                                     "generator (by GSL) type.", 0, NULL);
   strcpy(keyname5, "RNGSEED");
   gal_fits_add_to_fits_header_ll_end(&headers, TLONG, keyname5, 0,
-                                          &p->rng_seed, 0, "Random number "
-                                          "generator (by GSL) seed.", 0, NULL);
+                                     &p->rng_seed, 0, "Random number "
+                                     "generator (by GSL) seed.", 0, NULL);
 
   /* Save the output: */
   gal_fits_array_to_file(p->cp.output, "NoiseAdded", p->inputbitpix,
diff --git a/src/mknoise/ui.c b/src/mknoise/ui.c
index e1e6c87..806fb8e 100644
--- a/src/mknoise/ui.c
+++ b/src/mknoise/ui.c
@@ -30,10 +30,10 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <string.h>
 #include <fitsio.h>
 
-#include <nproc.h>              /* From Gnulib.                     */
+#include <nproc.h>               /* From Gnulib.                   */
 
 #include <gnuastro/fits.h>
-#include <gnuastro/timing.h>    /* Includes time.h and sys/time.h   */
+#include <gnuastro/timing.h>     /* Includes time.h and sys/time.h */
 #include <gnuastro/checkset.h>
 #include <gnuastro/txtarray.h>
 #include <gnuastro/commonargs.h>
@@ -41,8 +41,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* Needs main.h                   */
-#include "args.h"              /* Needs main.h, includes argp.h. */
+#include "ui.h"                  /* Needs main.h                   */
+#include "args.h"                /* Needs main.h, includes argp.h. */
 
 
 /* Set the file names of the places where the default parameters are
@@ -72,7 +72,7 @@ readconfig(char *filename, struct mknoiseparams *p)
   char *line, *name, *value;
   struct uiparams *up=&p->up;
   struct gal_commonparams *cp=&p->cp;
-  char key='a';        /* Not used, just a place holder. */
+  char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
      might be intentional, so there is no error. If a parameter is
@@ -89,7 +89,7 @@ readconfig(char *filename, struct mknoiseparams *p)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   /* Read the tokens in the file:  */
   while(getline(&line, &len, fp) != -1)
@@ -105,26 +105,26 @@ readconfig(char *filename, struct mknoiseparams *p)
         gal_checkset_allocate_copy_set(value, &cp->hdu, &cp->hduset);
 
       else if(strcmp(name, "background")==0)
-       {
-         if(up->backgroundset) continue;
-          gal_checkset_any_double(value, &p->mbackground, value, key, SPACK,
-                                  filename, lineno);
-         up->backgroundset=1;
-       }
+        {
+          if(up->backgroundset) continue;
+          gal_checkset_any_double(value, &p->mbackground, value, key,
+                                  SPACK, filename, lineno);
+          up->backgroundset=1;
+        }
       else if(strcmp(name, "zeropoint")==0)
-       {
-         if(up->zeropointset) continue;
-          gal_checkset_any_double(value, &p->zeropoint, value, key, SPACK,
-                                  filename, lineno);
-         up->zeropointset=1;
-       }
+        {
+          if(up->zeropointset) continue;
+          gal_checkset_any_double(value, &p->zeropoint, value, key,
+                                  SPACK, filename, lineno);
+          up->zeropointset=1;
+        }
       else if(strcmp(name, "stdadd")==0)
-       {
-         if(up->stdaddset) continue;
+        {
+          if(up->stdaddset) continue;
           gal_checkset_double_el_0(value, &p->stdadd, value, key, SPACK,
                                    filename, lineno);
-         up->stdaddset=1;
-       }
+          up->stdaddset=1;
+        }
 
 
 
@@ -141,8 +141,8 @@ readconfig(char *filename, struct mknoiseparams *p)
 
 
       else
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     "`%s` not recognized.\n", name);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      "`%s` not recognized.\n", name);
     }
 
   free(line);
diff --git a/src/mkprof/args.h b/src/mkprof/args.h
index f1c27de..e316892 100644
--- a/src/mkprof/args.h
+++ b/src/mkprof/args.h
@@ -429,9 +429,9 @@ parse_opt(int key, char *arg, struct argp_state *state)
      user is warned and the program is stopped: */
   if(arg && arg[0]=='=')
     argp_error(state, "incorrect use of the equal sign (`=`). For short "
-              "options, `=` should not be used and for long options, "
-              "there should be no space between the option, equal sign "
-              "and value");
+               "options, `=` should not be used and for long options, "
+               "there should be no space between the option, equal sign "
+               "and value");
 
   switch(key)
     {
@@ -607,20 +607,20 @@ parse_opt(int key, char *arg, struct argp_state *state)
 
       /* See what type of input value it is and put it in. */
       if( gal_fits_name_is_fits(arg) )
-       {
-         if(p->up.backname)
-           argp_error(state, "only one input FITS image (the background) "
-                      "should be input. You have given more");
-         else
-           p->up.backname=arg;
-       }
+        {
+          if(p->up.backname)
+            argp_error(state, "only one input FITS image (the background) "
+                       "should be input. You have given more");
+          else
+            p->up.backname=arg;
+        }
       else
-       {
-         if(p->up.catname)
-           argp_error(state, "only one catalog file can be given");
-         else
-           p->up.catname=arg;
-       }
+        {
+          if(p->up.catname)
+            argp_error(state, "only one catalog file can be given");
+          else
+            p->up.catname=arg;
+        }
       break;
 
 
@@ -631,13 +631,13 @@ parse_opt(int key, char *arg, struct argp_state *state)
     /* The command line options and arguments are finished. */
     case ARGP_KEY_END:
       if(p->cp.setdirconf==0 && p->cp.setusrconf==0
-        && p->cp.printparams==0)
-       {
-         if(state->arg_num==0)
-           argp_error(state, "no argument given");
-         if(p->up.catname==NULL)
-           argp_error(state, "no catalog provided");
-       }
+         && p->cp.printparams==0)
+        {
+          if(state->arg_num==0)
+            argp_error(state, "no argument given");
+          if(p->up.catname==NULL)
+            argp_error(state, "no catalog provided");
+        }
       break;
 
 
@@ -668,6 +668,6 @@ struct argp_child children[]=
 
 /* Basic structure defining the whole argument reading process. */
 static struct argp thisargp = {options, parse_opt, args_doc,
-                              doc, children, NULL, NULL};
+                               doc, children, NULL, NULL};
 
 #endif
diff --git a/src/mkprof/cite.h b/src/mkprof/cite.h
index cdd76bb..738c956 100644
--- a/src/mkprof/cite.h
+++ b/src/mkprof/cite.h
@@ -25,14 +25,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #define MKPROFBIBTEX ""
 
-#define PRINTCITEABORT {                                               \
-    printf("\nWe hope %s has been useful for your research.\n"         \
-          "Citations are vital for the continued work on %s.\n"        \
-          "Thank you for citing it in your research paper.\n"          \
-          "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
-          SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
-           GAL_STRINGS_MAIN_BIBTEX, MKPROFBIBTEX);                     \
-    exit(EXIT_SUCCESS);                                                        
\
+#define PRINTCITEABORT {                                                \
+    printf("\nWe hope %s has been useful for your research.\n"          \
+           "Citations are vital for the continued work on %s.\n"        \
+           "Thank you for citing it in your research paper.\n"          \
+           "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
+           SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
+           GAL_STRINGS_MAIN_BIBTEX, MKPROFBIBTEX);                      \
+    exit(EXIT_SUCCESS);                                                 \
 }
 
 #endif
diff --git a/src/mkprof/main.c b/src/mkprof/main.c
index afb2b10..ab2b5de 100644
--- a/src/mkprof/main.c
+++ b/src/mkprof/main.c
@@ -31,7 +31,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include "main.h"
 #include "mkprof.h"
 
-#include "ui.h"                        /* needs main.h.                  */
+#include "ui.h"                 /* needs main.h.                  */
 
 int
 main (int argc, char *argv[])
diff --git a/src/mkprof/mkprof.c b/src/mkprof/mkprof.c
index 77dfc67..b50bed6 100644
--- a/src/mkprof/mkprof.c
+++ b/src/mkprof/mkprof.c
@@ -73,7 +73,7 @@ preparewcs(struct mkprofparams *p)
   wcs.flag=-1;
   if( (status=wcsini(1, 2, &wcs)) )
     error(EXIT_FAILURE, 0, "wcsinit error %d: %s",
-         status, wcs_errmsg[status]);
+          status, wcs_errmsg[status]);
 
   /* Correct the CRPIX values. */
   p->crpix[0]=p->crpix[0]*os+p->shift[0]-os/2;
@@ -97,17 +97,17 @@ preparewcs(struct mkprofparams *p)
   /* Set up the wcs structure: */
   if( (status=wcsset(&wcs)) )
     error(EXIT_FAILURE, 0, "wcsset error %d: %s", status,
-         wcs_errmsg[status]);
+          wcs_errmsg[status]);
 
   /* Write the WCS structure to a header string. */
   if( (status=wcshdo(WCSHDO_safe, &wcs, &p->wcsnkeyrec, &p->wcsheader)) )
     error(EXIT_FAILURE, 0, "wcshdo error %d: %s", status,
-         wcs_errmsg[status]);
+          wcs_errmsg[status]);
 
   /* Free the allocated spaces by wcsini/wcsset: */
   if( (status=wcsfree(&wcs)) )
     error(EXIT_FAILURE, 0, "wcsfree error %d: %s", status,
-         wcs_errmsg[status]);
+          wcs_errmsg[status]);
 }
 
 
@@ -143,7 +143,7 @@ builtqueue_addempty(struct builtqueue **bq)
   tbq=malloc(sizeof *tbq);
   if(tbq==NULL)
     error(EXIT_FAILURE, 0, "%lu byte element in builtqueue_addempty",
-         sizeof *tbq);
+          sizeof *tbq);
 
   /* Initialize some of the values. */
   tbq->img=NULL;
@@ -196,8 +196,8 @@ saveindividual(struct mkonthread *mkp)
   outname=malloc(len*sizeof *outname);
   if(outname==NULL)
     error(EXIT_FAILURE, errno, "%lu bytes for name of object in "
-         "row %lu of %s", len*sizeof *outname, ibq->id,
-         p->up.catname);
+          "row %lu of %s", len*sizeof *outname, ibq->id,
+          p->up.catname);
 
   /* Save the correct CRPIX values: */
   crpix[0] = p->crpix[0] - os*(mkp->fpixel_i[0]-1);
@@ -222,8 +222,8 @@ saveindividual(struct mkonthread *mkp)
                            SPACK_STRING);
   else
     gal_fits_atof_correct_wcs(outname, "MockImg", FLOAT_IMG, ibq->img,
-                                   mkp->width[1], mkp->width[0], p->wcsheader,
-                                   p->wcsnkeyrec, crpix, SPACK_STRING);
+                              mkp->width[1], mkp->width[0], p->wcsheader,
+                              p->wcsnkeyrec, crpix, SPACK_STRING);
   ibq->indivcreated=1;
 
   /* Change 0.0f values to NAN: */
@@ -238,7 +238,8 @@ saveindividual(struct mkonthread *mkp)
     {
       errno=0;
       jobname=malloc((len+100)*sizeof *jobname);
-      if(jobname==NULL)        error(EXIT_FAILURE, errno, "jobname in 
mkprof.c");
+      if(jobname==NULL)
+        error(EXIT_FAILURE, errno, "jobname in mkprof.c");
       sprintf(jobname, "%s created.", outname);
       gal_timing_report(NULL, jobname, 2);
       free(jobname);
@@ -313,11 +314,11 @@ build(void *inparam)
   for(i=0;mkp->indexs[i]!=GAL_THREADS_NON_THRD_INDEX;++i)
     {
       /* Create a new builtqueue element with all the information. fbq
-        will be used when we want to add ibq to p->bq. It is defined
-        so we don't have to waste time traversing the ibq. Its
-        characteristic compared to the other elements of ibq is that
-        fbq->next==NULL. So to add ibq to p->bq, we just have to set
-        fbq->next=p->bq and then set p->bq to ibq.*/
+         will be used when we want to add ibq to p->bq. It is defined
+         so we don't have to waste time traversing the ibq. Its
+         characteristic compared to the other elements of ibq is that
+         fbq->next==NULL. So to add ibq to p->bq, we just have to set
+         fbq->next=p->bq and then set p->bq to ibq.*/
       builtqueue_addempty(&mkp->ibq);
       ibq=mkp->ibq;
       ibq->id=mkp->indexs[i];
@@ -331,26 +332,27 @@ build(void *inparam)
 
       /* Find the bounding box size (NOT oversampled). */
       if((int)cat[p->fcol]==POINTCODE)
-       mkp->width[0]=mkp->width[1]=1;
+        mkp->width[0]=mkp->width[1]=1;
       else
         gal_box_ellipse_in_box(mkp->truncr, mkp->q*mkp->truncr,
                                cat[p->pcol]*DEGREESTORADIANS, mkp->width);
 
 
       /* Get the overlapping pixels using the starting points (NOT
-        oversampled). */
+         oversampled). */
       gal_box_border_from_center(cat[p->xcol], cat[p->ycol], mkp->width,
                                  ibq->fpixel_i, ibq->lpixel_i);
       mkp->fpixel_i[0]=ibq->fpixel_i[0];
       mkp->fpixel_i[1]=ibq->fpixel_i[1];
-      ibq->overlaps = gal_box_overlap(mkp->onaxes, ibq->fpixel_i, 
ibq->lpixel_i,
-                                      ibq->fpixel_o, lpixel_o);
+      ibq->overlaps = gal_box_overlap(mkp->onaxes, ibq->fpixel_i,
+                                      ibq->lpixel_i, ibq->fpixel_o,
+                                      lpixel_o);
 
 
       /* Build the profile if necessary, After this, the width is
-        oversampled. */
+         oversampled. */
       if(ibq->overlaps || p->individual || (ibq->ispsf && p->psfinimg==0))
-       {
+        {
           /* Put a copy of the main random number generator for this
              thread to use for this profile. */
           gsl_rng_memcpy(mkp->rng, p->rng);
@@ -361,48 +363,48 @@ build(void *inparam)
             gsl_rng_set(mkp->rng, gal_timing_time_based_rng_seed());
 
           /* Make the profile */
-         makeoneprofile(mkp);
-         if( p->individual || (ibq->ispsf && p->psfinimg==0))
-           {
-             saveindividual(mkp);
-             if(ibq->ispsf && p->psfinimg==0)
-               ibq->overlaps=0;
-           }
-       }
+          makeoneprofile(mkp);
+          if( p->individual || (ibq->ispsf && p->psfinimg==0))
+            {
+              saveindividual(mkp);
+              if(ibq->ispsf && p->psfinimg==0)
+                ibq->overlaps=0;
+            }
+        }
 
       /* Add ibq to bq if you can lock the mutex. */
       if(p->cp.numthreads>1)
-       {
-         /* Try locking the mutex so no thread can change the value
-            of p->bq. If you can lock it, then put the internal
-            builtqueue on top of the general builtqueue. If you
-            can't, continue adding to the internal builtqueue (make
-            the next profiles) until you find a chance to lock the
-            mutex. */
-         lockresult=pthread_mutex_trylock(qlock);
-         if(lockresult==0)     /* Mutex was successfully locked. */
-           {
-             /* Add this internal queue to system queue. */
-             fbq->next=p->bq;
-             p->bq=ibq;
-
-             /* If the list was empty when you locked the mutex, then
-                either `write` is waiting behind a condition variable
-                for you to fill it up or not (either it hasn't got to
-                setting the condition variable yet (this function
-                locked the mutex before `write`) or it just got the
-                list to be made and is busy writing the arrays in the
-                output). In either case, pthread_cond_signal will
-                work. */
-             if(fbq->next==NULL)
-               pthread_cond_signal(qready);
-             pthread_mutex_unlock(qlock);
-
-             /* Finally set both the internal queue and the first
-                internal queue element to NULL.*/
-             fbq=NULL;
-             mkp->ibq=NULL;
-           }
+        {
+          /* Try locking the mutex so no thread can change the value
+             of p->bq. If you can lock it, then put the internal
+             builtqueue on top of the general builtqueue. If you
+             can't, continue adding to the internal builtqueue (make
+             the next profiles) until you find a chance to lock the
+             mutex. */
+          lockresult=pthread_mutex_trylock(qlock);
+          if(lockresult==0)     /* Mutex was successfully locked. */
+            {
+              /* Add this internal queue to system queue. */
+              fbq->next=p->bq;
+              p->bq=ibq;
+
+              /* If the list was empty when you locked the mutex, then
+                 either `write` is waiting behind a condition variable
+                 for you to fill it up or not (either it hasn't got to
+                 setting the condition variable yet (this function
+                 locked the mutex before `write`) or it just got the
+                 list to be made and is busy writing the arrays in the
+                 output). In either case, pthread_cond_signal will
+                 work. */
+              if(fbq->next==NULL)
+                pthread_cond_signal(qready);
+              pthread_mutex_unlock(qlock);
+
+              /* Finally set both the internal queue and the first
+                 internal queue element to NULL.*/
+              fbq=NULL;
+              mkp->ibq=NULL;
+            }
           /* The mutex couldn't be locked and there are no more
              objects for this thread to build (giving a chance for
              this thread to add up its built profiles). So we have to
@@ -410,13 +412,13 @@ build(void *inparam)
              builtqueue. */
           else if (mkp->indexs[i+1]==GAL_THREADS_NON_THRD_INDEX)
             {
-             pthread_mutex_lock(qlock);
-             fbq->next=p->bq;
-             p->bq=ibq;
+              pthread_mutex_lock(qlock);
+              fbq->next=p->bq;
+              p->bq=ibq;
               pthread_cond_signal(qready);
-             pthread_mutex_unlock(qlock);
+              pthread_mutex_unlock(qlock);
             }
-       }
+        }
     }
 
   /* Free the allocated space for this thread and wait until all other
@@ -460,15 +462,15 @@ writelog(struct mkprofparams *p)
   int int_cols[]={0, 2, 4, -1}, accu_cols[]={-1};
 
   sprintf(comments, "# Log file for "SPACK_STRING".\n"
-         "# Run on %s"
-         "# Column 0: Row number in catalog (starting from zero).\n"
-         "# Column 1: Overlap magnitude with final image "
-         "(zeropoint: %.3f).\n"
-         "# Column 2: Number of Monte Carlo integration pixels.\n"
-         "# Column 3: Fraction of brightness in Monte Carlo "
+          "# Run on %s"
+          "# Column 0: Row number in catalog (starting from zero).\n"
+          "# Column 1: Overlap magnitude with final image "
+          "(zeropoint: %.3f).\n"
+          "# Column 2: Number of Monte Carlo integration pixels.\n"
+          "# Column 3: Fraction of brightness in Monte Carlo "
           "integrated pixels.\n"
-         "# Column 4: An individual image was created.\n",
-         ctime(&p->rawtime), p->zeropoint);
+          "# Column 4: An individual image was created.\n",
+          ctime(&p->rawtime), p->zeropoint);
 
 
   gal_txtarray_array_to_txt(p->log, p->cs0, LOGNUMCOLS, comments, int_cols,
@@ -513,54 +515,54 @@ write(struct mkprofparams *p)
     {
       /* Set ibq. */
       if(ibq==NULL)
-       {
-         if(p->cp.numthreads==1)
-           ibq=p->bq;
-         else
-           {
-             pthread_mutex_lock(&p->qlock);
-             while(p->bq==NULL)
+        {
+          if(p->cp.numthreads==1)
+            ibq=p->bq;
+          else
+            {
+              pthread_mutex_lock(&p->qlock);
+              while(p->bq==NULL)
                 pthread_cond_wait(&p->qready, &p->qlock);
-             ibq=p->bq;
-             p->bq=NULL;
-             pthread_mutex_unlock(&p->qlock);
-           }
-       }
+              ibq=p->bq;
+              p->bq=NULL;
+              pthread_mutex_unlock(&p->qlock);
+            }
+        }
       sum=0.0f;
 
       /* Write the array pointed to by ibq into the output image. Note
-        that the FITS and C arrays have opposite axis orders and FITS
-        counting starts from 1, not zero. Also fpixel is the first
-        (inclusive) pixel and so is lpixel (it is inclusive). */
+         that the FITS and C arrays have opposite axis orders and FITS
+         counting starts from 1, not zero. Also fpixel is the first
+         (inclusive) pixel and so is lpixel (it is inclusive). */
       if(ibq->overlaps && p->nomerged==0)
-       {
-         /* Set the starting and ending points in the complete image. */
-         i  = os * (ibq->fpixel_i[1]-1);
-         j  = os * (ibq->fpixel_i[0]-1);
-
-         /* Set the starting and ending points in the overlapping
-            image. Note that oversampling has already been taken
-            into account in ibq->width. */
-         ow = ibq->imgwidth;
-         ii = os * (ibq->fpixel_o[1]-1);
-         jj = os * (ibq->fpixel_o[0]-1);
-
-         /* Find the width of the overlapping region: */
-         iw = os*(ibq->lpixel_i[1]-ibq->fpixel_i[1]+1);
-         jw = os*(ibq->lpixel_i[0]-ibq->fpixel_i[0]+1);
-
-         /* Write the overlap to the actual image. Instead of writing
-            two for loops and summing all the row and column indexs
-            for every pixel and each image, we use pointer arithmetic
-            which is much more efficient. Just think of one pointer
-            that is advancing over the final image (*to) and one that
-            is advancing over the overlap image (*from). Since we
-            know the images overlap, iw and jw are both smaller than
-            the two image number of columns and number of rows, so
-            w-jw and ow-jw will always be positive. */
-         to=out+i*w+j;
-         from=ibq->img+ii*ow+jj;
-         rowend=to+iw*w;
+        {
+          /* Set the starting and ending points in the complete image. */
+          i  = os * (ibq->fpixel_i[1]-1);
+          j  = os * (ibq->fpixel_i[0]-1);
+
+          /* Set the starting and ending points in the overlapping
+             image. Note that oversampling has already been taken
+             into account in ibq->width. */
+          ow = ibq->imgwidth;
+          ii = os * (ibq->fpixel_o[1]-1);
+          jj = os * (ibq->fpixel_o[0]-1);
+
+          /* Find the width of the overlapping region: */
+          iw = os*(ibq->lpixel_i[1]-ibq->fpixel_i[1]+1);
+          jw = os*(ibq->lpixel_i[0]-ibq->fpixel_i[0]+1);
+
+          /* Write the overlap to the actual image. Instead of writing
+             two for loops and summing all the row and column indexs
+             for every pixel and each image, we use pointer arithmetic
+             which is much more efficient. Just think of one pointer
+             that is advancing over the final image (*to) and one that
+             is advancing over the overlap image (*from). Since we
+             know the images overlap, iw and jw are both smaller than
+             the two image number of columns and number of rows, so
+             w-jw and ow-jw will always be positive. */
+          to=out+i*w+j;
+          from=ibq->img+ii*ow+jj;
+          rowend=to+iw*w;
           do
             {
               colend=to+jw;
@@ -575,10 +577,10 @@ write(struct mkprofparams *p)
                   ++from;
                 }
               while(++to<colend);
-              to+=w-jw; from+=ow-jw;        /* Go to next row. */
+              to+=w-jw; from+=ow-jw;             /* Go to next row. */
             }
           while(to<rowend);
-       }
+        }
 
       /* Fill the log array. */
       log=&p->log[ibq->id*LOGNUMCOLS];
@@ -591,21 +593,21 @@ write(struct mkprofparams *p)
       /* Report if in verbose mode. */
       ++complete;
       if(verb && p->nomerged==0)
-       {
-         errno=0;
-         jobname=malloc(100*sizeof *jobname);
-         if(jobname==NULL)
-           error(EXIT_FAILURE, errno, "jobname in mkprof.c");
-         sprintf(jobname, "row %lu complete, %lu left to go",
-                 ibq->id, cs0-complete);
-         gal_timing_report(NULL, jobname, 2);
-         free(jobname);
-       }
+        {
+          errno=0;
+          jobname=malloc(100*sizeof *jobname);
+          if(jobname==NULL)
+            error(EXIT_FAILURE, errno, "jobname in mkprof.c");
+          sprintf(jobname, "row %lu complete, %lu left to go",
+                  ibq->id, cs0-complete);
+          gal_timing_report(NULL, jobname, 2);
+          free(jobname);
+        }
 
       /* Free the array and the queue element and change it to the
-        next one and increment complete. Note that there is no
-        problem to free a NULL pointer (when the built array didn't
-        overlap). */
+         next one and increment complete. Note that there is no
+         problem to free a NULL pointer (when the built array didn't
+         overlap). */
       free(ibq->img);
       tbq=ibq->next;
       free(ibq);
@@ -634,15 +636,15 @@ write(struct mkprofparams *p)
                                        p->wcsheader, p->wcsnkeyrec,
                                        NULL, SPACK_STRING);
       if(verb)
-       {
-         errno=0;
-         jobname=malloc((strlen(p->mergedimgname)+100)*sizeof *jobname);
-         if(jobname==NULL)
-           error(EXIT_FAILURE, errno, "final report in mkprof.c");
-         sprintf(jobname, "%s created.", p->mergedimgname);
-         gal_timing_report(&t1, jobname, 1);
-         free(jobname);
-       }
+        {
+          errno=0;
+          jobname=malloc((strlen(p->mergedimgname)+100)*sizeof *jobname);
+          if(jobname==NULL)
+            error(EXIT_FAILURE, errno, "final report in mkprof.c");
+          sprintf(jobname, "%s created.", p->mergedimgname);
+          gal_timing_report(&t1, jobname, 1);
+          free(jobname);
+        }
     }
 
   free(out);
@@ -674,7 +676,7 @@ void
 mkprof(struct mkprofparams *p)
 {
   int err;
-  pthread_t t;          /* Thread id not used, all are saved here. */
+  pthread_t t;            /* Thread id not used, all are saved here. */
   pthread_attr_t attr;
   pthread_barrier_t b;
   struct mkonthread *mkp;
@@ -694,7 +696,7 @@ mkprof(struct mkprofparams *p)
   mkp=malloc(nt*sizeof *mkp);
   if(mkp==NULL)
     error(EXIT_FAILURE, errno,
-         "%lu bytes in mkprof (mkprof.c) for mkp", (nt-1)*sizeof *mkp);
+          "%lu bytes in mkprof (mkprof.c) for mkp", (nt-1)*sizeof *mkp);
 
   /* Distribute the different profiles for different threads. Note
      that one thread is left out for writing, while nt-1 are left
@@ -717,8 +719,8 @@ mkprof(struct mkprofparams *p)
   else
     {
       /* Initialize the attributes. Note that this main thread will
-        also have to be kept behind the barrier, so we need nt+1
-        barrier stops. */
+         also have to be kept behind the barrier, so we need nt+1
+         barrier stops. */
       if(p->cs0<nt) nb=p->cs0+1;
       else nb=nt+1;
       gal_threads_attr_barrier_init(&attr, &b, nb);
@@ -731,18 +733,18 @@ mkprof(struct mkprofparams *p)
 
       /* Spin off the threads: */
       for(i=0;i<nt;++i)
-       if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
-         {
-           mkp[i].p=p;
-           mkp[i].b=&b;
-           mkp[i].ibq=NULL;
-           mkp[i].onaxes=onaxes;
+        if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
+          {
+            mkp[i].p=p;
+            mkp[i].b=&b;
+            mkp[i].ibq=NULL;
+            mkp[i].onaxes=onaxes;
             mkp[i].rng=gsl_rng_clone(p->rng);
-           mkp[i].indexs=&indexs[i*thrdcols];
-           err=pthread_create(&t, &attr, build, &mkp[i]);
-           if(err)
-             error(EXIT_FAILURE, 0, "can't create thread %lu", i);
-         }
+            mkp[i].indexs=&indexs[i*thrdcols];
+            err=pthread_create(&t, &attr, build, &mkp[i]);
+            if(err)
+              error(EXIT_FAILURE, 0, "can't create thread %lu", i);
+          }
     }
 
   /* Write the created arrays into the image. */
diff --git a/src/mkprof/oneprofile.c b/src/mkprof/oneprofile.c
index 75abd3a..716c7a0 100644
--- a/src/mkprof/oneprofile.c
+++ b/src/mkprof/oneprofile.c
@@ -28,9 +28,9 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <error.h>
 #include <stdlib.h>
 
-#include <sys/time.h>           /* generate random seed */
-#include <gsl/gsl_rng.h>        /* used in setrandoms   */
-#include <gsl/gsl_randist.h>    /* To make noise.       */
+#include <sys/time.h>            /* generate random seed */
+#include <gsl/gsl_rng.h>         /* used in setrandoms   */
+#include <gsl/gsl_randist.h>     /* To make noise.       */
 #include <gsl/gsl_integration.h> /* gsl_integration_qng  */
 
 #include <gnuastro/fits.h>
@@ -71,8 +71,8 @@ r_circle(size_t p, struct mkonthread *mkp)
 {
   double x, y;
 
-  x = p/mkp->width[0];         /* Note that width[0] is the First FITS */
-  y = p%mkp->width[0];         /* axis, not first C axis.              */
+  x = p/mkp->width[0];   /* Note that width[0] is the First FITS */
+  y = p%mkp->width[0];   /* axis, not first C axis.              */
 
   return sqrt( (x-mkp->xc)*(x-mkp->xc) + (y-mkp->yc)*(y-mkp->yc) );
 }
@@ -174,7 +174,7 @@ twod_over_xy(double y, void *params)
 
   mkp->y=y;
   gsl_integration_qng(&F, mkp->xl, mkp->xh, epsabs, epsrel,
-                     &result, &abserr, &neval);
+                      &result, &abserr, &neval);
   return result;
 }
 
@@ -193,7 +193,7 @@ integ2d(struct mkonthread *mkp)
   F.function = &twod_over_xy;
   F.params = mkp;
   gsl_integration_qng(&F, mkp->yl, mkp->yh, epsabs,
-                     epsrel, &result, &abserr, &neval);
+                      epsrel, &result, &abserr, &neval);
   return result;
 }
 
@@ -235,7 +235,9 @@ makepixbypix(struct mkonthread *mkp)
   double (*profile)(struct mkonthread *)=mkp->profile;
   double xc=mkp->xc, yc=mkp->yc, os=mkp->p->oversample;
   double truncr=mkp->truncr, approx, hp=mkp->p->halfpixel;
-  struct gal_linkedlist_tosll *lQ=NULL, *sQ; /* lQ: Largest. sQ: Smallest in 
queue */
+
+  /* lQ: Largest. sQ: Smallest in queue */
+  struct gal_linkedlist_tosll *lQ=NULL, *sQ;
 
   /* Find the nearest pixel to the profile center and add it to the
      queue. */
@@ -254,8 +256,8 @@ makepixbypix(struct mkonthread *mkp)
   byt=calloc(is0*is1, sizeof *byt);
   if(byt==NULL)
     error(EXIT_FAILURE, 0, "%lu bytes for map of object in row %lu of "
-         "data in %s", is0*is1*sizeof *byt, ibq->id,
-         mkp->p->up.catname);
+          "data in %s", is0*is1*sizeof *byt, ibq->id,
+          mkp->p->up.catname);
 
   /* Start the queue: */
   byt[p]=1;
@@ -310,8 +312,8 @@ makepixbypix(struct mkonthread *mkp)
           /*
             printf("\tac: %f, ap: %f, frac: %f\n", img[p], approx,
             fabs(img[p]-approx)/img[p]);
-            gal_fits_array_to_file("tmp.fits", "", FLOAT_IMG, img, is0, is1,
-            NULL, SPACK_STRING);
+            gal_fits_array_to_file("tmp.fits", "", FLOAT_IMG, img, is0,
+                                   is1, NULL, SPACK_STRING);
           */
 
           /* Go over the neighbours and add them to queue of elements
@@ -340,7 +342,7 @@ makepixbypix(struct mkonthread *mkp)
   /* Order doesn't matter any more, add all the pixels you find. */
   while(Q)
     {
-      pop_from_sll(&Q, ind);   /* ind=&p */
+      pop_from_sll(&Q, ind);        /* ind=&p */
       mkp->x=(p/is1-xc)/os;
       mkp->y=(p%is1-yc)/os;
       r_el(mkp);
@@ -361,18 +363,18 @@ makepixbypix(struct mkonthread *mkp)
 
       /*
       gal_fits_array_to_file("tmp.fits", "", FLOAT_IMG, img, is0, is1,
-                            NULL, SPACK_STRING);
+                              NULL, SPACK_STRING);
       */
       /* Go over the neighbours and add them to queue of elements
-        to check. */
+         to check. */
       GAL_NEIGHBORS_FILL_4_ALLIMG;
       nf=(n=ngb)+numngb;
       do
-       if(byt[*n]==0)
-         {
-           byt[*n]=1;
-           add_to_sll(&Q, *n);
-         }
+        if(byt[*n]==0)
+          {
+            byt[*n]=1;
+            add_to_sll(&Q, *n);
+          }
       while(++n<nf);
     }
   free(byt);
@@ -452,7 +454,7 @@ setprofparams(struct mkonthread *mkp)
       mkp->moffat_alphasq  *= mkp->moffat_alphasq;
       mkp->truncr           = tp ? cat[tcol] : cat[tcol]*cat[rcol]/2;
       if(p->psfinimg==0 && p->individual==0)
-       { mkp->brightness=1.0f; cat[p->xcol]=0.0f; cat[p->ycol]=0.0f; }
+        { mkp->brightness=1.0f; cat[p->xcol]=0.0f; cat[p->ycol]=0.0f; }
       break;
 
     case GAUSSIANCODE:
@@ -461,7 +463,7 @@ setprofparams(struct mkonthread *mkp)
       mkp->gaussian_c       = -1.0f/(2.0f*sigma*sigma);
       mkp->truncr           = tp ? cat[tcol] : cat[tcol]*cat[rcol]/2;
       if(p->psfinimg==0 && p->individual==0)
-       { mkp->brightness=1.0f; cat[p->xcol]=0.0f; cat[p->ycol]=0.0f; }
+        { mkp->brightness=1.0f; cat[p->xcol]=0.0f; cat[p->ycol]=0.0f; }
       break;
 
     case POINTCODE:
@@ -485,9 +487,9 @@ setprofparams(struct mkonthread *mkp)
 
     default:
       error(EXIT_FAILURE, 0, "a bug in setprofparams (oneprofile.c)! "
-           "The profile code is not recognized. This should have been "
-           "seen and reported prior to this step. Please contact us so "
-           "we can correct this");
+            "The profile code is not recognized. This should have been "
+            "seen and reported prior to this step. Please contact us so "
+            "we can correct this");
     }
 
 }
@@ -530,12 +532,12 @@ makeoneprofile(struct mkonthread *mkp)
      is in the non-oversampled scale.*/
   pixfrac = modf(fabs(cat[p->xcol]), &intpart);
   mkp->yc = ( os * (mkp->width[0]/2 + pixfrac)
-             + (pixfrac<0.50f ? os/2 : -1*os/2-1) );
+              + (pixfrac<0.50f ? os/2 : -1*os/2-1) );
   mkp->yc = round(mkp->yc*100)/100;
 
   pixfrac = modf(fabs(cat[p->ycol]), &intpart);
   mkp->xc = ( os*(mkp->width[1]/2 + pixfrac)
-             + (pixfrac<0.5f ? os/2 : -1*os/2-1) );
+              + (pixfrac<0.5f ? os/2 : -1*os/2-1) );
   mkp->xc = round(mkp->xc*100)/100;
 
 
@@ -552,7 +554,7 @@ makeoneprofile(struct mkonthread *mkp)
   mkp->ibq->img=malloc(size*sizeof *mkp->ibq->img);
   if(mkp->ibq->img==NULL)
     error(EXIT_FAILURE, 0, "%lu bytes for object in row %lu of data in %s",
-         size*sizeof *mkp->ibq->img, mkp->ibq->id, mkp->p->up.catname);
+          size*sizeof *mkp->ibq->img, mkp->ibq->id, mkp->p->up.catname);
   gal_arraymanip_fset_const(mkp->ibq->img, size, NAN);
 
 
diff --git a/src/mkprof/profiles.c b/src/mkprof/profiles.c
index 60b6eb4..cd01264 100644
--- a/src/mkprof/profiles.c
+++ b/src/mkprof/profiles.c
@@ -28,7 +28,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <gsl/gsl_sf_gamma.h>  /* For total Sersic brightness. */
+#include <gsl/gsl_sf_gamma.h>   /* For total Sersic brightness. */
 
 #include "main.h"
 #include "mkprof.h"             /* Needs main.h, astrthreads.h */
@@ -118,7 +118,7 @@ sersic_b(double n)
 {
   if(n<=0.35f)
     error(EXIT_FAILURE, 0, "the Sersic index cannot be smaller "
-         "than 0.35. It is %.3f", n);
+          "than 0.35. It is %.3f", n);
   return 2*n-(1/3)+(4/(405*n))+(46/(25515*n*n))+
     (131/(1148175*n*n*n)-(2194697/(30690717750*n*n*n*n)));
 }
@@ -133,7 +133,7 @@ double
 Sersic(struct mkonthread *mkp)
 {
   return exp( mkp->sersic_nb
-             * ( pow(mkp->r/mkp->sersic_re, mkp->sersic_inv_n) -1 ) );
+              * ( pow(mkp->r/mkp->sersic_re, mkp->sersic_inv_n) -1 ) );
 }
 
 
@@ -147,7 +147,7 @@ double
 totsersic(double n, double re, double b, double q)
 {
   return (2*M_PI*re*re*exp(b)*n*pow(b, -2*n)*q*
-         gsl_sf_gamma(2*n));
+          gsl_sf_gamma(2*n));
 }
 
 
diff --git a/src/mkprof/ui.c b/src/mkprof/ui.c
index cf73f91..08ad2bf 100644
--- a/src/mkprof/ui.c
+++ b/src/mkprof/ui.c
@@ -43,9 +43,9 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include "main.h"
 #include "mkprof.h"
 
-#include "ui.h"                        /* Needs main.h.                  */
-#include "args.h"              /* Needs main.h, includes argp.h. */
-#include "oneprofile.h"                /* Needs main.h and mkprof.h.     */
+#include "ui.h"                  /* Needs main.h.                  */
+#include "args.h"                /* Needs main.h, includes argp.h. */
+#include "oneprofile.h"          /* Needs main.h and mkprof.h.     */
 
 
 /* Set the file names of the places where the default parameters are
@@ -72,7 +72,7 @@ readconfig(char *filename, struct mkprofparams *p)
   struct uiparams *up=&p->up;
   size_t lineno=0, len=200, tmp;
   struct gal_commonparams *cp=&p->cp;
-  char key='a';        /* Not used, just a place holder. */
+  char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
      might be intentional, so there is no error. If a parameter is
@@ -89,7 +89,7 @@ readconfig(char *filename, struct mkprofparams *p)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   /* Read the tokens in the file:  */
   while(getline(&line, &len, fp) != -1)
@@ -106,159 +106,160 @@ readconfig(char *filename, struct mkprofparams *p)
         gal_checkset_allocate_copy_set(value, &cp->output, &cp->outputset);
 
       else if(strcmp(name, "naxis1")==0)
-       {
-         if(up->naxis1set) continue;
-         gal_checkset_sizet_l_zero(value, &tmp, name, key, SPACK,
+        {
+          if(up->naxis1set) continue;
+          gal_checkset_sizet_l_zero(value, &tmp, name, key, SPACK,
                                     filename, lineno);
-         p->naxes[0]=tmp;
-         up->naxis1set=1;
-       }
+          p->naxes[0]=tmp;
+          up->naxis1set=1;
+        }
       else if(strcmp(name, "naxis2")==0)
-       {
-         if(up->naxis2set) continue;
-         gal_checkset_sizet_l_zero(value, &tmp, name, key, SPACK,
+        {
+          if(up->naxis2set) continue;
+          gal_checkset_sizet_l_zero(value, &tmp, name, key, SPACK,
                                     filename, lineno);
-         p->naxes[1]=tmp;
-         up->naxis2set=1;
-       }
+          p->naxes[1]=tmp;
+          up->naxis2set=1;
+        }
       else if(strcmp(name, "oversample")==0)
-       {
-         if(up->oversampleset) continue;
-         gal_checkset_sizet_l_zero(value, &p->oversample, name, key, SPACK,
-                                    filename, lineno);
-         up->oversampleset=1;
-       }
+        {
+          if(up->oversampleset) continue;
+          gal_checkset_sizet_l_zero(value, &p->oversample, name, key,
+                                    SPACK, filename, lineno);
+          up->oversampleset=1;
+        }
 
 
 
 
       /* Profiles: */
       else if(strcmp(name, "tunitinp")==0)
-       {
-         if(up->tunitinpset) continue;
-         gal_checkset_int_zero_or_one(value, &p->tunitinp, name, key, SPACK,
-                                       filename, lineno);
-         up->tunitinpset=1;
-       }
+        {
+          if(up->tunitinpset) continue;
+          gal_checkset_int_zero_or_one(value, &p->tunitinp, name, key,
+                                       SPACK, filename, lineno);
+          up->tunitinpset=1;
+        }
       else if(strcmp(name, "numrandom")==0)
-       {
-         if(up->numrandomset) continue;
-         gal_checkset_sizet_l_zero(value, &p->numrandom, name, key, SPACK,
+        {
+          if(up->numrandomset) continue;
+          gal_checkset_sizet_l_zero(value, &p->numrandom, name, key, SPACK,
                                     filename, lineno);
-         up->numrandomset=1;
-       }
+          up->numrandomset=1;
+        }
       else if(strcmp(name, "tolerance")==0)
-       {
-         if(up->toleranceset) continue;
-         gal_checkset_float_l_0(value, &p->tolerance, name, key, SPACK,
+        {
+          if(up->toleranceset) continue;
+          gal_checkset_float_l_0(value, &p->tolerance, name, key, SPACK,
                                  filename, lineno);
-         up->toleranceset=1;
-       }
+          up->toleranceset=1;
+        }
       else if(strcmp(name, "zeropoint")==0)
-       {
-         if(up->zeropointset) continue;
-         gal_checkset_any_float(value, &p->zeropoint, name, key, SPACK,
+        {
+          if(up->zeropointset) continue;
+          gal_checkset_any_float(value, &p->zeropoint, name, key, SPACK,
                                  filename, lineno);
-         up->zeropointset=1;
-       }
+          up->zeropointset=1;
+        }
       else if(strcmp(name, "prepforconv")==0)
-       {
-         if(up->prepforconvset) continue;
-         gal_checkset_int_zero_or_one(value, &p->up.prepforconv, name, key,
+        {
+          if(up->prepforconvset) continue;
+          gal_checkset_int_zero_or_one(value, &p->up.prepforconv, name, key,
                                        SPACK, filename, lineno);
-         up->prepforconvset=1;
-       }
+          up->prepforconvset=1;
+        }
       else if(strcmp(name, "xshift")==0)
-       {
-         if(up->xshiftset) continue;
-         gal_checkset_sizet_el_zero(value, &tmp, name, key, SPACK,
+        {
+          if(up->xshiftset) continue;
+          gal_checkset_sizet_el_zero(value, &tmp, name, key, SPACK,
                                      filename, lineno);
-         p->shift[0]=tmp;
-         up->xshiftset=1;
-       }
+          p->shift[0]=tmp;
+          up->xshiftset=1;
+        }
       else if(strcmp(name, "yshift")==0)
-       {
-         if(up->yshiftset) continue;
-         gal_checkset_sizet_el_zero(value, &tmp, name, key, SPACK,
+        {
+          if(up->yshiftset) continue;
+          gal_checkset_sizet_el_zero(value, &tmp, name, key, SPACK,
                                      filename, lineno);
-         p->shift[1]=tmp;
-         up->yshiftset=1;
-       }
+          p->shift[1]=tmp;
+          up->yshiftset=1;
+        }
       else if(strcmp(name, "circumwidth")==0)
-       {
-         if(up->circumwidthset) continue;
-          gal_checkset_double_l_value(value, &p->circumwidth, name, key, SPACK,
-                                      MINCIRCUMWIDTH, filename, lineno);
-         up->circumwidthset=1;
-       }
+        {
+          if(up->circumwidthset) continue;
+          gal_checkset_double_l_value(value, &p->circumwidth, name, key,
+                                      SPACK, MINCIRCUMWIDTH, filename,
+                                      lineno);
+          up->circumwidthset=1;
+        }
 
 
 
 
       /* Catalog: */
       else if(strcmp(name, "xcol")==0)
-       {
-         if(up->xcolset) continue;
-         gal_checkset_sizet_el_zero(value, &p->xcol, name, key, SPACK,
+        {
+          if(up->xcolset) continue;
+          gal_checkset_sizet_el_zero(value, &p->xcol, name, key, SPACK,
                                      filename, lineno);
-         up->xcolset=1;
-       }
+          up->xcolset=1;
+        }
       else if(strcmp(name, "ycol")==0)
-       {
-         if(up->ycolset) continue;
-         gal_checkset_sizet_el_zero(value, &p->ycol, name, key, SPACK,
+        {
+          if(up->ycolset) continue;
+          gal_checkset_sizet_el_zero(value, &p->ycol, name, key, SPACK,
                                      filename, lineno);
-         up->ycolset=1;
-       }
+          up->ycolset=1;
+        }
       else if(strcmp(name, "fcol")==0)
-       {
-         if(up->fcolset) continue;
-         gal_checkset_sizet_el_zero(value, &p->fcol, name, key, SPACK,
+        {
+          if(up->fcolset) continue;
+          gal_checkset_sizet_el_zero(value, &p->fcol, name, key, SPACK,
                                      filename, lineno);
-         up->fcolset=1;
-       }
+          up->fcolset=1;
+        }
       else if(strcmp(name, "rcol")==0)
-       {
-         if(up->rcolset) continue;
-         gal_checkset_sizet_el_zero(value, &p->rcol, name, key, SPACK,
+        {
+          if(up->rcolset) continue;
+          gal_checkset_sizet_el_zero(value, &p->rcol, name, key, SPACK,
                                      filename, lineno);
-         up->rcolset=1;
-       }
+          up->rcolset=1;
+        }
       else if(strcmp(name, "ncol")==0)
-       {
-         if(up->ncolset) continue;
-         gal_checkset_sizet_el_zero(value, &p->ncol, name, key, SPACK,
+        {
+          if(up->ncolset) continue;
+          gal_checkset_sizet_el_zero(value, &p->ncol, name, key, SPACK,
                                      filename, lineno);
-         up->ncolset=1;
-       }
+          up->ncolset=1;
+        }
       else if(strcmp(name, "pcol")==0)
-       {
-         if(up->pcolset) continue;
-         gal_checkset_sizet_el_zero(value, &p->pcol, name, key, SPACK,
+        {
+          if(up->pcolset) continue;
+          gal_checkset_sizet_el_zero(value, &p->pcol, name, key, SPACK,
                                      filename, lineno);
-         up->pcolset=1;
-       }
+          up->pcolset=1;
+        }
       else if(strcmp(name, "qcol")==0)
-       {
-         if(up->qcolset) continue;
-         gal_checkset_sizet_el_zero(value, &p->qcol, name, key, SPACK,
+        {
+          if(up->qcolset) continue;
+          gal_checkset_sizet_el_zero(value, &p->qcol, name, key, SPACK,
                                      filename, lineno);
-         up->qcolset=1;
-       }
+          up->qcolset=1;
+        }
       else if(strcmp(name, "mcol")==0)
-       {
-         if(up->mcolset) continue;
-         gal_checkset_sizet_el_zero(value, &p->mcol, name, key, SPACK,
+        {
+          if(up->mcolset) continue;
+          gal_checkset_sizet_el_zero(value, &p->mcol, name, key, SPACK,
                                      filename, lineno);
-         up->mcolset=1;
-       }
+          up->mcolset=1;
+        }
       else if(strcmp(name, "tcol")==0)
-       {
-         if(up->tcolset) continue;
-         gal_checkset_sizet_el_zero(value, &p->tcol, name, key, SPACK,
+        {
+          if(up->tcolset) continue;
+          gal_checkset_sizet_el_zero(value, &p->tcol, name, key, SPACK,
                                      filename, lineno);
-         up->tcolset=1;
-       }
+          up->tcolset=1;
+        }
 
 
 
@@ -266,40 +267,40 @@ readconfig(char *filename, struct mkprofparams *p)
 
       /* WCS: */
       else if(strcmp(name, "crpix1")==0)
-       {
-         if(up->crpix1set) continue;
-         gal_checkset_any_double(value, &p->crpix[0], name, key, SPACK,
+        {
+          if(up->crpix1set) continue;
+          gal_checkset_any_double(value, &p->crpix[0], name, key, SPACK,
                                   filename, lineno);
-         up->crpix1set=1;
-       }
+          up->crpix1set=1;
+        }
       else if(strcmp(name, "crpix2")==0)
-       {
-         if(up->crpix2set) continue;
-         gal_checkset_any_double(value, &p->crpix[1], name, key, SPACK,
+        {
+          if(up->crpix2set) continue;
+          gal_checkset_any_double(value, &p->crpix[1], name, key, SPACK,
                                   filename, lineno);
-         up->crpix2set=1;
-       }
+          up->crpix2set=1;
+        }
       else if(strcmp(name, "crval1")==0)
-       {
-         if(up->crval1set) continue;
-         gal_checkset_any_double(value, &p->crval[0], name, key, SPACK,
+        {
+          if(up->crval1set) continue;
+          gal_checkset_any_double(value, &p->crval[0], name, key, SPACK,
                                   filename, lineno);
-         up->crval1set=1;
-       }
+          up->crval1set=1;
+        }
       else if(strcmp(name, "crval2")==0)
-       {
-         if(up->crval2set) continue;
-         gal_checkset_any_double(value, &p->crval[1], name, key, SPACK,
+        {
+          if(up->crval2set) continue;
+          gal_checkset_any_double(value, &p->crval[1], name, key, SPACK,
                                   filename, lineno);
-         up->crval2set=1;
-       }
+          up->crval2set=1;
+        }
       else if(strcmp(name, "resolution")==0)
-       {
-         if(up->resolutionset) continue;
-         gal_checkset_any_float(value, &p->resolution, name, key, SPACK,
+        {
+          if(up->resolutionset) continue;
+          gal_checkset_any_float(value, &p->resolution, name, key, SPACK,
                                  filename, lineno);
-         up->resolutionset=1;
-       }
+          up->resolutionset=1;
+        }
 
 
 
@@ -309,8 +310,8 @@ readconfig(char *filename, struct mkprofparams *p)
 
 
       else
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     "`%s` not recognized.\n", name);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      "`%s` not recognized.\n", name);
     }
 
   free(line);
@@ -509,10 +510,10 @@ sanitycheck(struct mkprofparams *p)
   for(i=0;i<9;++i)
     for(j=0;j<9;++j)
       if(i!=j && columns[i]==columns[j])
-       error(EXIT_FAILURE, 0, "at least two of the specified columns "
-             "are set to %lu! By adding the `-P` or `--printparams` "
-             "option you can check the final column numbers. They "
-             "all have to be different", columns[i]);
+        error(EXIT_FAILURE, 0, "at least two of the specified columns "
+              "are set to %lu! By adding the `-P` or `--printparams` "
+              "option you can check the final column numbers. They "
+              "all have to be different", columns[i]);
 
 
   /* If all the columns are within the catalog: */
@@ -531,8 +532,8 @@ sanitycheck(struct mkprofparams *p)
   for(i=0;i<p->cs0;++i)
     if(cat[i*cs1+p->fcol]<0 || cat[i*cs1+p->fcol]>MAXIMUMCODE)
       error(EXIT_FAILURE, 0, "%s: In row %lu, the function code should"
-           "be positive and smaller or equal to %d",
-           p->up.catname, i+1, MAXIMUMCODE);
+            "be positive and smaller or equal to %d",
+            p->up.catname, i+1, MAXIMUMCODE);
 
 
   /* If any of xshift or yshift is non-zero, the other should be too!
@@ -541,44 +542,45 @@ sanitycheck(struct mkprofparams *p)
      1. Otherwise the sum will either be 0 or 2.*/
   switch ( (p->shift[0]!=0) + (p->shift[1]!=0) )
     {
-      /* If prepforconv is called, then xshift and yshift should be zero. Also
-        a Moffat or Gaussian profile should exist in the image. */
+      /* If prepforconv is called, then xshift and yshift should be
+         zero. Also a Moffat or Gaussian profile should exist in the
+         image. */
     case 0:
       if(p->up.prepforconv)
-       {
-         /* Check if there is at least one Moffat or Gaussian profile. */
-         j=0;
-         for(i=0;i<p->cs0;++i)
-           if(ispsf(cat[i*cs1+p->fcol]))
-             {
-               j=i;
-               break;
-             }
-
-         /* If there is no PSF in the catalog, then you can ignore
-            prepforconv. */
-         if(i<p->cs0)
-           {
-             /* Set the row, to simplify: */
-             row=&cat[j*cs1];
-
-             /* Find the correct xshift and yshift using the first Moffat
-                or Gaussian profile (in row 'j'). Note that the output of
-                encloseellipse will be the total width, we only want half
-                of it for the shift.*/
-             truncr = ( p->tunitinp ? row[p->tcol] :
-                        row[p->tcol] * row[p->rcol]/2);
+        {
+          /* Check if there is at least one Moffat or Gaussian profile. */
+          j=0;
+          for(i=0;i<p->cs0;++i)
+            if(ispsf(cat[i*cs1+p->fcol]))
+              {
+                j=i;
+                break;
+              }
+
+          /* If there is no PSF in the catalog, then you can ignore
+             prepforconv. */
+          if(i<p->cs0)
+            {
+              /* Set the row, to simplify: */
+              row=&cat[j*cs1];
+
+              /* Find the correct xshift and yshift using the first Moffat
+                 or Gaussian profile (in row 'j'). Note that the output of
+                 encloseellipse will be the total width, we only want half
+                 of it for the shift.*/
+              truncr = ( p->tunitinp ? row[p->tcol] :
+                         row[p->tcol] * row[p->rcol]/2);
               gal_box_ellipse_in_box(truncr, row[p->qcol]*truncr,
                                      row[p->pcol]*DEGREESTORADIANS, width);
-             p->shift[0]  = (width[0]/2)*p->oversample;
-             p->shift[1]  = (width[1]/2)*p->oversample;
-           }
-       }
+              p->shift[0]  = (width[0]/2)*p->oversample;
+              p->shift[1]  = (width[1]/2)*p->oversample;
+            }
+        }
       break;
 
     case 1:
       error(EXIT_FAILURE, 0, "at least one of `--xshift` (`-X`) or "
-           "`--yshift` (`-Y`) are zero");
+            "`--yshift` (`-Y`) are zero");
       break;
 
     case 2:
@@ -588,7 +590,7 @@ sanitycheck(struct mkprofparams *p)
 
     default:
       error(EXIT_FAILURE, 0, "a bug in sanitycheck (ui.c)! In checks "
-           "for shifts. Please contact us so we can fix it");
+            "for shifts. Please contact us so we can fix it");
     }
   p->naxes[0] += 2*p->shift[0];
   p->naxes[1] += 2*p->shift[1];
@@ -596,12 +598,12 @@ sanitycheck(struct mkprofparams *p)
 
   /* Check the output name: */
   d0f1=gal_checkset_dir_0_file_1(p->cp.output, p->cp.dontdelete);
-  if(d0f1)                     /* --output is a file name. */
+  if(d0f1)                        /* --output is a file name. */
     {
       p->mergedimgname=p->cp.output;
       p->outdir=gal_checkset_dir_part(p->mergedimgname);
     }
-  else                         /* --output is a directory name. */
+  else                                /* --output is a directory name. */
     {
       errno=0;
       p->outdir=malloc((strlen(p->cp.output)+1)*sizeof *p->outdir);
@@ -610,8 +612,9 @@ sanitycheck(struct mkprofparams *p)
               (strlen(p->cp.output)+1)*sizeof *p->outdir);
       strcpy(p->outdir, p->cp.output);
       gal_checkset_check_dir_write_add_slash(&p->outdir);
-      gal_checkset_automatic_output(p->up.catname, ".fits", 
p->cp.removedirinfo,
-                                    p->cp.dontdelete, &tmpname);
+      gal_checkset_automatic_output(p->up.catname, ".fits",
+                                    p->cp.removedirinfo, p->cp.dontdelete,
+                                    &tmpname);
       p->mergedimgname=gal_checkset_malloc_cat(p->outdir, tmpname);
       free(tmpname);
     }
@@ -650,7 +653,7 @@ preparearrays(struct mkprofparams *p)
   p->log=malloc(p->cs0*LOGNUMCOLS*sizeof *p->log);
   if(p->log==NULL)
     error(EXIT_FAILURE, 0, "Allocating %lu bytes for log file",
-         p->cs0*LOGNUMCOLS*sizeof *p->log);
+          p->cs0*LOGNUMCOLS*sizeof *p->log);
 
 
   /* If a background image is specified, then use that as the output
@@ -672,13 +675,14 @@ preparearrays(struct mkprofparams *p)
       else
         {
           gal_fits_change_type(array, p->bitpix, p->naxes[1]*p->naxes[0],
-                                    p->anyblank, (void **)(&p->out), 
FLOAT_IMG);
+                               p->anyblank, (void **)(&p->out), FLOAT_IMG);
           free(array);
         }
 
       /* If setconsttomin is called, then there should be an input image: */
       if(p->setconsttomin)
-        gal_statistics_float_min(p->out, p->naxes[1]*p->naxes[0], 
&p->constant);
+        gal_statistics_float_min(p->out, p->naxes[1]*p->naxes[0],
+                                 &p->constant);
     }
   else
     {
@@ -780,9 +784,10 @@ setparams(int argc, char *argv[], struct mkprofparams *p)
       printf(SPACK_NAME" started on %s", ctime(&p->rawtime));
       errno=0;
       jobname=malloc(strlen(p->up.catname)+100*sizeof *jobname);
-      if(jobname==NULL)        error(EXIT_FAILURE, errno, "jobname in ui.c");
+      if(jobname==NULL)
+        error(EXIT_FAILURE, errno, "jobname in ui.c");
       sprintf(jobname, "%lu profile%sread from %s", p->cs0,
-             p->cs0>1?"s ":" ", p->up.catname);
+              p->cs0>1?"s ":" ", p->up.catname);
       gal_timing_report(&t1, jobname, 1);
       free(jobname);
 
diff --git a/src/noisechisel/args.h b/src/noisechisel/args.h
index 8b8f4e1..832f8ca 100644
--- a/src/noisechisel/args.h
+++ b/src/noisechisel/args.h
@@ -549,9 +549,9 @@ parse_opt(int key, char *arg, struct argp_state *state)
      user is warned and the program is stopped: */
   if(arg && arg[0]=='=')
     argp_error(state, "incorrect use of the equal sign (`=`). For short "
-              "options, `=` should not be used and for long options, "
-              "there should be no space between the option, equal sign "
-              "and value");
+               "options, `=` should not be used and for long options, "
+               "there should be no space between the option, equal sign "
+               "and value");
 
   switch(key)
     {
@@ -795,7 +795,7 @@ parse_opt(int key, char *arg, struct argp_state *state)
             argp_error(state, "only one input image should be given");
           else
             p->up.inputname=arg;
-       }
+        }
       else
         argp_error(state, "%s is not a valid file type", arg);
       break;
@@ -807,13 +807,13 @@ parse_opt(int key, char *arg, struct argp_state *state)
     /* The command line options and arguments are finished. */
     case ARGP_KEY_END:
       if(p->cp.setdirconf==0 && p->cp.setusrconf==0
-        && p->cp.printparams==0)
-       {
-         if(state->arg_num==0)
-           argp_error(state, "no argument given");
-         if(p->up.inputname==NULL)
-           argp_error(state, "no input FITS image(s) provided");
-       }
+         && p->cp.printparams==0)
+        {
+          if(state->arg_num==0)
+            argp_error(state, "no argument given");
+          if(p->up.inputname==NULL)
+            argp_error(state, "no input FITS image(s) provided");
+        }
       break;
 
 
@@ -843,6 +843,6 @@ struct argp_child children[]=
 
 /* Basic structure defining the whole argument reading process. */
 static struct argp thisargp = {options, parse_opt, args_doc,
-                              doc, children, NULL, NULL};
+                               doc, children, NULL, NULL};
 
 #endif
diff --git a/src/noisechisel/binary.c b/src/noisechisel/binary.c
index 474b0a7..58cdc67 100644
--- a/src/noisechisel/binary.c
+++ b/src/noisechisel/binary.c
@@ -165,7 +165,8 @@ dilate0_erode1_4con(unsigned char *byt, size_t nr, size_t 
nc,
   if(b0_f1!=1 && b0_f1!=0)
     error(EXIT_FAILURE, 0, "a bug! Please contact us at %s so we can fix "
           "this problem. In dilate0_erode1_4con (binary.c), the value to "
-          "b0_f1 is %u while it should be 0 or 1", PACKAGE_BUGREPORT, b0_f1);
+          "b0_f1 is %u while it should be 0 or 1", PACKAGE_BUGREPORT,
+          b0_f1);
 
   /* Set the foreground and background values. */
   if(b0_f1==0) {f=1; b=0;}
@@ -196,35 +197,35 @@ dilate0_erode1_4con(unsigned char *byt, size_t nr, size_t 
nc,
     {
       ind=(nr-1)*nc+j;
       if(byt[ind]==b
-        && (byt[ind+1]==f || byt[ind-1]==f || byt[ind-nc]==f) )
-       byt[ind]=BINARYTMP;
+         && (byt[ind+1]==f || byt[ind-1]==f || byt[ind-nc]==f) )
+        byt[ind]=BINARYTMP;
     }
 
   for(i=1;i<nr-1;++i)
     {
       ind=i*nc;
       if(byt[ind]==b
-        && (byt[ind+1]==f || byt[ind+nc]==f || byt[ind-nc]==f) )
-       byt[ind]=BINARYTMP;
+         && (byt[ind+1]==f || byt[ind+nc]==f || byt[ind-nc]==f) )
+        byt[ind]=BINARYTMP;
     }
 
   for(i=1;i<nr-1;++i)
     {
       ind=(i+1)*nc-1;
       if(byt[ind]==b
-        && (byt[ind-1]==f || byt[ind+nc]==f || byt[ind-nc]==f) )
-       byt[ind]=BINARYTMP;
+         && (byt[ind-1]==f || byt[ind+nc]==f || byt[ind-nc]==f) )
+        byt[ind]=BINARYTMP;
     }
 
   /* Check the body: */
   for(i=1;i<nr-1;++i)
     for(j=1;j<nc-1;++j)
       {
-       ind=i*nc+j;
-       if(byt[ind]==b
-          && (byt[ind-1]==f     || byt[ind+1]==f
-              || byt[ind+nc]==f || byt[ind-nc]==f) )
-         byt[ind]=BINARYTMP;
+        ind=i*nc+j;
+        if(byt[ind]==b
+           && (byt[ind-1]==f     || byt[ind+1]==f
+               || byt[ind+nc]==f || byt[ind-nc]==f) )
+          byt[ind]=BINARYTMP;
       }
 
   /* Set all the changed pixels to the proper values: */
@@ -249,7 +250,8 @@ dilate0_erode1_8con(unsigned char *byt, size_t nr, size_t 
nc,
   if(b0_f1!=1 && b0_f1!=0)
     error(EXIT_FAILURE, 0, "a bug! Please contact us at %s so we can fix "
           "this problem. In dilate0_erode1_4con (binary.c), the value to "
-          "b0_f1 is %u while it should be 0 or 1", PACKAGE_BUGREPORT, b0_f1);
+          "b0_f1 is %u while it should be 0 or 1", PACKAGE_BUGREPORT,
+          b0_f1);
 
   /* Set the foreground and background values: */
   if(b0_f1==0) {f=1; b=0;}
@@ -257,69 +259,69 @@ dilate0_erode1_8con(unsigned char *byt, size_t nr, size_t 
nc,
 
   /* Check the 4 corners: */
   if(byt[0]==b && (byt[1]==f
-                  || byt[nc]==f || byt[nc+1]==f) )
+                   || byt[nc]==f || byt[nc+1]==f) )
     byt[0]=BINARYTMP;
 
   if(byt[nc-1]==b && (byt[nc-2]==f
-                     || byt[2*nc-1]==f
-                     || byt[2*nc-2]==f) )
+                      || byt[2*nc-1]==f
+                      || byt[2*nc-2]==f) )
     byt[nc-1]=BINARYTMP;
 
   if(byt[(nr-1)*nc]==b
      && ( byt[(nr-2)*nc]==f || byt[(nr-1)*nc+1]==f
-         || byt[(nr-2)*nc+1]==f) )
+          || byt[(nr-2)*nc+1]==f) )
     byt[(nr-1)*nc]=BINARYTMP;
 
   if(byt[nr*nc-1]==b
      && ( byt[nr*nc-2]==f || byt[nr*nc-1-nc]==f
-         || byt[nr*nc-2-nc]==f) )
+          || byt[nr*nc-2-nc]==f) )
     byt[nr*nc-1]=BINARYTMP;
 
   /* Check the 4 sides: */
   for(j=1;j<nc-1;++j)
     if(byt[j]==b
        && ( byt[j+1]==f || byt[j-1]==f || byt[j+nc]==f
-           || byt[j-1+nc]==f || byt[j+1+nc]==f) )
+            || byt[j-1+nc]==f || byt[j+1+nc]==f) )
       byt[j]=BINARYTMP;
 
   for(j=1;j<nc-1;++j)
     {
       ind=(nr-1)*nc+j;
       if(byt[ind]==b
-        && ( byt[ind+1]==f || byt[ind-1]==f || byt[ind-nc]==f
-             || byt[ind-1-nc]==f || byt[ind+1-nc]==f) )
-       byt[ind]=BINARYTMP;
+         && ( byt[ind+1]==f || byt[ind-1]==f || byt[ind-nc]==f
+              || byt[ind-1-nc]==f || byt[ind+1-nc]==f) )
+        byt[ind]=BINARYTMP;
     }
 
   for(i=1;i<nr-1;++i)
     {
       ind=i*nc;
       if(byt[ind]==b
-        && ( byt[ind+1]==f || byt[ind+nc]==f || byt[ind-nc]==f
-             || byt[ind+1-nc]==f || byt[ind+1+nc]==f) )
-       byt[ind]=BINARYTMP;
+         && ( byt[ind+1]==f || byt[ind+nc]==f || byt[ind-nc]==f
+              || byt[ind+1-nc]==f || byt[ind+1+nc]==f) )
+        byt[ind]=BINARYTMP;
     }
 
   for(i=1;i<nr-1;++i)
     {
       ind=(i+1)*nc-1;
       if(byt[ind]==b
-        && (byt[ind-1]==f || byt[ind+nc]==f || byt[ind-nc]==f
-            || byt[ind-1-nc]==f || byt[ind-1+nc]==f) )
-       byt[ind]=BINARYTMP;
+         && (byt[ind-1]==f || byt[ind+nc]==f || byt[ind-nc]==f
+             || byt[ind-1-nc]==f || byt[ind-1+nc]==f) )
+        byt[ind]=BINARYTMP;
     }
 
   /* Check the body: */
   for(i=1;i<nr-1;++i)
     for(j=1;j<nc-1;++j)
       {
-       ind=i*nc+j;
-       if(byt[ind]==b
-          && (byt[ind-1]==f        || byt[ind+1]==f
-              || byt[ind+nc]==f    || byt[ind-nc]==f
-              || byt[ind-1-nc]==f  || byt[ind+1+nc]==f
-              || byt[ind-1+nc]==f  || byt[ind+1-nc]==f) )
-         byt[ind]=BINARYTMP;
+        ind=i*nc+j;
+        if(byt[ind]==b
+           && (byt[ind-1]==f        || byt[ind+1]==f
+               || byt[ind+nc]==f    || byt[ind-nc]==f
+               || byt[ind-1-nc]==f  || byt[ind+1+nc]==f
+               || byt[ind-1+nc]==f  || byt[ind+1-nc]==f) )
+          byt[ind]=BINARYTMP;
       }
 
   /* Set all the changed pixels to the proper values: */
@@ -394,13 +396,13 @@ fillleftside(unsigned char *inv, size_t idx, size_t idy,
       index=i*idy+2;
       if(inv[index]==1 && inv[index+idy]==0)
         {
-         if(i+1-min_o<maxfill)
-           for(j=min_o;j<=i+1;++j)
-             inv[j*idy+1]=BINARYTMP;
-         min_o=i+1;
+          if(i+1-min_o<maxfill)
+            for(j=min_o;j<=i+1;++j)
+              inv[j*idy+1]=BINARYTMP;
+          min_o=i+1;
         }
       else if(inv[index]==0 && inv[index+idy]==1)
-       min_o=i;
+        min_o=i;
     }
   if(min_o!=1 && end-min_o<maxfill)
     for(j=min_o;j<=end;++j)
@@ -424,13 +426,13 @@ fillbottomside(unsigned char *inv, size_t idy,
       index=2*idy+i;
       if(inv[index]==1 && inv[index+1]==0)
         {
-         if(i+1-min_o<maxfill)
-           for(j=min_o;j<=i+1;++j)
-             inv[idy+j]=BINARYTMP;
-         min_o=i+1;
+          if(i+1-min_o<maxfill)
+            for(j=min_o;j<=i+1;++j)
+              inv[idy+j]=BINARYTMP;
+          min_o=i+1;
         }
       else if(inv[index]==0 && inv[index+1]==1)
-       min_o=i;
+        min_o=i;
     }
   if(min_o!=1 && end-min_o<maxfill)
     for(j=min_o;j<=end;++j)
@@ -454,13 +456,13 @@ fillrightside(unsigned char *inv, size_t idx, size_t idy,
       index=i*idy+idy-3;
       if(inv[index]==1 && inv[index+idy]==0)
         {
-         if(i+1-min_o<maxfill)
-           for(j=min_o;j<=i+1;++j)
-             inv[j*idy+idy-2]=BINARYTMP;
-         min_o=i+1;
+          if(i+1-min_o<maxfill)
+            for(j=min_o;j<=i+1;++j)
+              inv[j*idy+idy-2]=BINARYTMP;
+          min_o=i+1;
         }
       else if(inv[index]==0 && inv[index+idy]==1)
-       min_o=i;
+        min_o=i;
     }
   if(min_o!=1 && end-min_o<maxfill)
     for(j=min_o;j<=end;++j)
@@ -484,13 +486,13 @@ filltopside(unsigned char *inv, size_t idx, size_t idy,
       index=(idx-3)*idy+i;
       if(inv[index]==1 && inv[index+1]==0)
         {
-         if(i+1-min_o<maxfill)
-           for(j=min_o;j<=i+1;++j)
-             inv[(idx-2)*idy+j]=BINARYTMP;
-         min_o=i+1;
+          if(i+1-min_o<maxfill)
+            for(j=min_o;j<=i+1;++j)
+              inv[(idx-2)*idy+j]=BINARYTMP;
+          min_o=i+1;
         }
       else if(inv[index]==0 && inv[index+1]==1)
-       min_o=i;
+        min_o=i;
     }
   if(min_o!=1 && end-min_o<maxfill)
     for(j=min_o;j<=end;++j)
@@ -509,8 +511,8 @@ filltopside(unsigned char *inv, size_t idx, size_t idy,
    objects that are touching the image border. */
 void
 fh_makeinv(unsigned char *byt, size_t s0, size_t s1,
-          unsigned char **inv, size_t *oidx, size_t *oidy,
-          size_t l, size_t b, size_t r, size_t t, int anyblank)
+           unsigned char **inv, size_t *oidx, size_t *oidy,
+           size_t l, size_t b, size_t r, size_t t, int anyblank)
 {
   unsigned char *tinv, *bp, *bf, *tp, *sp;
   size_t i, row, start, idx, idy, size, tdiff=2;
diff --git a/src/noisechisel/cite.h b/src/noisechisel/cite.h
index e587b45..5777694 100644
--- a/src/noisechisel/cite.h
+++ b/src/noisechisel/cite.h
@@ -25,14 +25,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #define NOISECHISELBIBTEX ""
 
-#define PRINTCITEABORT {                                               \
-    printf("\nWe hope %s has been useful for your research.\n"         \
-          "Citations are vital for the continued work on %s.\n"        \
-          "Thank you for citing it in your research paper.\n"          \
-          "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
-          SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
-           GAL_STRINGS_MAIN_BIBTEX, NOISECHISELBIBTEX);                        
\
-    exit(EXIT_SUCCESS);                                                        
\
+#define PRINTCITEABORT {                                                \
+    printf("\nWe hope %s has been useful for your research.\n"          \
+           "Citations are vital for the continued work on %s.\n"        \
+           "Thank you for citing it in your research paper.\n"          \
+           "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
+           SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
+           GAL_STRINGS_MAIN_BIBTEX, NOISECHISELBIBTEX);                 \
+    exit(EXIT_SUCCESS);                                                 \
 }
 
 #endif
diff --git a/src/noisechisel/clumps.c b/src/noisechisel/clumps.c
index 2c9dddb..eb1ddab 100644
--- a/src/noisechisel/clumps.c
+++ b/src/noisechisel/clumps.c
@@ -76,11 +76,11 @@ oversegment(struct clumpsthreadparams *ctp)
 {
   struct noisechiselparams *p=ctp->p;
 
-  /* pix is not actually used its self, however, the pointer to it
-     will be extensively used (ind) for the macro GAL_NEIGHBORS_FILL_8_REGION.
+  /* pix is not actually used its self, however, the pointer to it will be
+     extensively used (ind) for the macro GAL_NEIGHBORS_FILL_8_REGION.
      This macro works on the pointer to the index, not the index its
-     self. `pix` is filled with different index values, so the pointer
-     to it doesn't change. */
+     self. `pix` is filled with different index values, so the pointer to
+     it doesn't change. */
   size_t pix;
 
   float *arr=p->conv;
@@ -91,7 +91,8 @@ oversegment(struct clumpsthreadparams *ctp)
   size_t ng, *rn, *rnf, numngb, ngb[8], *relngb=p->relngb;
 
   /* Sort the indexs based on the flux within them. */
-  qsort(ctp->inds, ctp->area, sizeof(size_t), 
gal_qsort_index_float_decreasing);
+  qsort(ctp->inds, ctp->area, sizeof(size_t),
+        gal_qsort_index_float_decreasing);
 
   /* Initialize the region you want to over-segment. */
   indf=(pind=ctp->inds)+ctp->area;
@@ -396,28 +397,28 @@ growclumps(struct clumpsthreadparams *ctp, int withrivers)
   while(thisround>numblanks)
     {
       /* "thisround" will keep the number of pixels to be inspected in
-        this round. "numblanks" will count the number of pixels left
-        without an index by the end of this round. Since numblack
-        comes from the previous loop (or outside for the first loop)
-        it has to be saved in "thisround" to begin counting a
-        fresh. */
+         this round. "numblanks" will count the number of pixels left
+         without an index by the end of this round. Since numblack
+         comes from the previous loop (or outside for the first loop)
+         it has to be saved in "thisround" to begin counting a
+         fresh. */
       thisround=numblanks;
       numblanks=0;
 
       /* Go over all the available indexs to fill: */
       indf = ( ind=ctp->blankinds ) + thisround;
       do
-       {
-         /* We begin by assuming the neighbor label is zero (meaning
-            that no neighbor actually exists!) */
-         n1=0;
+        {
+          /* We begin by assuming the neighbor label is zero (meaning
+             that no neighbor actually exists!) */
+          n1=0;
 
-         /* Check the 4 connected neighbors of the pixel: */
+          /* Check the 4 connected neighbors of the pixel: */
           GAL_NEIGHBORS_FILL_4_ALLIMG;
-         nf=(n=ngb)+numngb;
-         do
-            if( olab[*n]>0 )                /* This neighbor is labeled. */
-           {
+          nf=(n=ngb)+numngb;
+          do
+            if( olab[*n]>0 )                 /* This neighbor is labeled. */
+            {
               if(n1)           /* A previous neighboring label was found. */
                 {
                   if(n1!=olab[*n])      /* This neighbor has a new label. */
@@ -431,18 +432,18 @@ growclumps(struct clumpsthreadparams *ctp, int withrivers)
                   n1=olab[*n];
                   if(!withrivers) break;
                 }
-           }
-         while(++n<nf);
-
-         /* The loop above finishes with three possibilities:
-              n1==0            --> No labeled neighbor was found.
-              n1==SEGMENTINIT  --> It is connecting two labeled regions.
-              n1>0             --> It only has one neighbouring label.*/
-         if(n1==0)             /* First condition above. */
-           ctp->blankinds[numblanks++]=*ind;
-         else                  /* Last two conditions above. */
+            }
+          while(++n<nf);
+
+          /* The loop above finishes with three possibilities:
+               n1==0            --> No labeled neighbor was found.
+               n1==SEGMENTINIT  --> It is connecting two labeled regions.
+               n1>0             --> It only has one neighbouring label.*/
+          if(n1==0)                   /* First condition above. */
+            ctp->blankinds[numblanks++]=*ind;
+          else                        /* Last two conditions above. */
             olab[*ind]=n1;
-       }
+        }
       while(++ind<indf);
     }
 
@@ -701,11 +702,11 @@ clumpsntable(struct clumpsthreadparams *ctp, float 
**sntable)
       O  = clumpinfo[ row + 2 ];
 
       /* If the inner flux is smaller than the outer flux (happens
-        only in noise cases) or the area is smaller than the minimum
-        area to calculate signal-to-noise, then set the S/N of this
-        segment to zero. */
+         only in noise cases) or the area is smaller than the minimum
+         area to calculate signal-to-noise, then set the S/N of this
+         segment to zero. */
       if( Ni>p->segsnminarea && I>O )   /* This is O, not 0 (zero). */
-       {
+        {
           /* If the sky was subtracted then put in the second power of
              the standard deviation multiplied by two (because we are
              measuring two fluxs). */
@@ -719,11 +720,11 @@ clumpsntable(struct clumpsthreadparams *ctp, float 
**sntable)
              (for easy sorting and etc). Note that counter will always
              be smaller and equal to i. */
           ind = p->b0f1 ? i : counter++;
-         sntab[ind]=( sqrt((float)(Ni)/cpscorr)*(I-O)
-                      / sqrt( (I>0?I:-1*I) + (O>0?O:-1*O) + err ) );
-       }
+          sntab[ind]=( sqrt((float)(Ni)/cpscorr)*(I-O)
+                       / sqrt( (I>0?I:-1*I) + (O>0?O:-1*O) + err ) );
+        }
       else
-       sntab[i]=0;
+        sntab[i]=0;
     }
 
 
@@ -804,7 +805,7 @@ clumpsntableonmesh(void *inparams)
 
 
       /* Check to see if we have enough blank area for getting the
-        background noise statistics. */
+         background noise statistics. */
       count_f_b_onregion(p->byt, startind, s0, s1, is1, &nf, &ctp.area,
                          &anyblank);
       if( (float)ctp.area < (float)(s0*s1)*p->minbfrac )
@@ -960,7 +961,8 @@ removefalseclumps(struct clumpsthreadparams *ctp, float 
*sntable)
   errno=0; newlabs=malloc(ctp->numclumps*sizeof *newlabs);
   if(newlabs==NULL)
     error(EXIT_FAILURE, errno, "%lu bytes for newlabs in "
-          "removefalsedetections (clumps.c)", ctp->numclumps*sizeof *newlabs);
+          "removefalsedetections (clumps.c)",
+          ctp->numclumps*sizeof *newlabs);
 
   /* We want the removed regions to become SEGMENTINIT. */
   gal_arraymanip_long_init(newlabs, ctp->numclumps, SEGMENTINIT);
@@ -997,9 +999,9 @@ removefalseclumps(struct clumpsthreadparams *ctp, float 
*sntable)
   do
     {
       if(clab[*ind]>0)
-       clab[*ind] = newlabs[ clab[*ind] ];
+        clab[*ind] = newlabs[ clab[*ind] ];
       else
-       clab[*ind] = SEGMENTINIT;
+        clab[*ind] = SEGMENTINIT;
     }
   while(++ind<indf);
 
diff --git a/src/noisechisel/detection.c b/src/noisechisel/detection.c
index 0cdf39e..891a021 100644
--- a/src/noisechisel/detection.c
+++ b/src/noisechisel/detection.c
@@ -324,7 +324,8 @@ applydetsn(struct noisechiselparams *p, float *sntable, 
size_t numpseudo)
   errno=0; newlabs=calloc(numpseudo, sizeof *newlabs);
   if(newlabs==NULL)
     error(EXIT_FAILURE, errno, "%lu bytes for numlabs in "
-          "removefalsedetections (detections.c)", numpseudo*sizeof *newlabs);
+          "removefalsedetections (detections.c)",
+          numpseudo*sizeof *newlabs);
 
 
   for(i=1;i<numpseudo;++i)
@@ -459,7 +460,7 @@ detectpseudos(void *inparams)
          work for this mesh if this is the first step. */
       bytpartfromlarge(p, thisbyt, startind, s0, s1);
       if(detectionname && p->stepnum==1)
-       { bytparttolarge(p, thisbyt, startind, s0, s1); continue; }
+        { bytparttolarge(p, thisbyt, startind, s0, s1); continue; }
 
 
       /* If there were NaN pixels in the image, make sure if this
@@ -475,7 +476,7 @@ detectpseudos(void *inparams)
       /* Fill the bounded holes. */
       fillboundedholes(thisbyt, s0, s1, anyblank);
       if(detectionname && p->stepnum==2)
-       { bytparttolarge(p, thisbyt, startind, s0, s1); continue; }
+        { bytparttolarge(p, thisbyt, startind, s0, s1); continue; }
 
       /* Open the image once: */
       opening(thisbyt, s0, s1, 1, 4);
@@ -540,8 +541,8 @@ detsnthresh(struct noisechiselparams *p)
         {
           free(p->dbyt);    /* Free the old, p->dbyt, put the original */
           gal_arraymanip_uchar_copy(tmp, s0*s1, &p->dbyt);
-          gal_mesh_operate_on_mesh(lmp, detectpseudos, sizeof(unsigned char),
-                                   0, 0);
+          gal_mesh_operate_on_mesh(lmp, detectpseudos,
+                                   sizeof(unsigned char), 0, 0);
           switch(p->stepnum)
             {
             case 1:
@@ -565,7 +566,8 @@ detsnthresh(struct noisechiselparams *p)
       free(tmp);
     }
   else
-    gal_mesh_operate_on_mesh(lmp, detectpseudos, sizeof(unsigned char), 0, 0);
+    gal_mesh_operate_on_mesh(lmp, detectpseudos,
+                             sizeof(unsigned char), 0, 0);
 
 
   /* Find the connected components and the signal to noise ratio of
@@ -633,9 +635,9 @@ dbytolaboverlap(struct noisechiselparams *p)
       if(ISINDEXABLELABEL)
         {
           tokeep[ *lab ] =
-            tokeep[ *lab ]     /* Check if this label is to be kept.    */
-            ? 1                        /* It has, its all we need!             
 */
-            : *byt;            /* It hasn't, check if it should be kept.*/
+            tokeep[ *lab ]    /* Check if this label is to be kept.    */
+            ? 1               /* It has, its all we need!              */
+            : *byt;           /* It hasn't, check if it should be kept.*/
         }
       ++byt;
     }
diff --git a/src/noisechisel/label.c b/src/noisechisel/label.c
index 5bf7050..8713518 100644
--- a/src/noisechisel/label.c
+++ b/src/noisechisel/label.c
@@ -210,19 +210,19 @@ BF_concomp_AdjMatrix(int *adj, size_t numside, long 
**outnewlabs)
   for(i=1;i<numside;++i)
     if(newlabs[i]==0)
       {
-       add_to_sll(&Q, i);
-       while(Q!=NULL)
-         {
-           pop_from_sll(&Q, &p);
-           if(newlabs[p]!=curlab)
-             {
-               newlabs[p]=curlab;
-               for(j=1;j<numside;++j)
-                 if( adj[p*numside+j] && newlabs[j]==0 )
-                   add_to_sll(&Q, j);
-             }
-         }
-       ++curlab;
+        add_to_sll(&Q, i);
+        while(Q!=NULL)
+          {
+            pop_from_sll(&Q, &p);
+            if(newlabs[p]!=curlab)
+              {
+                newlabs[p]=curlab;
+                for(j=1;j<numside;++j)
+                  if( adj[p*numside+j] && newlabs[j]==0 )
+                    add_to_sll(&Q, j);
+              }
+          }
+        ++curlab;
       }
 
   /* For a check:
@@ -288,7 +288,7 @@ labareas(long *lab, size_t size, size_t numlabs, size_t 
**outareas)
 
 void
 removesmallarea_relabel(long *in, unsigned char *byt, size_t size,
-                       size_t *numlabs, size_t minarea)
+                        size_t *numlabs, size_t minarea)
 {
   size_t i, *areas;
   long *newlabs, curlab=1;
@@ -369,8 +369,8 @@ labindexs(long *inlab, size_t size, size_t numlabs, size_t 
**outareas,
       errno=0;
       labinds[i]=malloc(areas[i]*sizeof **labinds);
       if(labinds[i]==NULL)
-        error(EXIT_FAILURE, errno, "%lu bytes for labinds[%lu] in labindexs "
-              "(label.c)", areas[i]*sizeof **labinds, i);
+        error(EXIT_FAILURE, errno, "%lu bytes for labinds[%lu] in "
+              "labindexs (label.c)", areas[i]*sizeof **labinds, i);
     }
 
   /* Fill in the indexs array. */
@@ -386,9 +386,9 @@ labindexs(long *inlab, size_t size, size_t numlabs, size_t 
**outareas,
     size_t j;
     for(i=1;i<numlabs;++i)
       {
-       printf("Lab: %lu\n", i);
-       for(j=0;j<areas[i];++j)
-         printf("  %lu\n", labinds[i][j]);
+        printf("Lab: %lu\n", i);
+        for(j=0;j<areas[i];++j)
+          printf("  %lu\n", labinds[i][j]);
       }
     exit(0);
   }
diff --git a/src/noisechisel/label.h b/src/noisechisel/label.h
index d849e12..d3bb12e 100644
--- a/src/noisechisel/label.h
+++ b/src/noisechisel/label.h
@@ -55,7 +55,7 @@ BF_concomp_AdjMatrix(int *adj, size_t numside, long 
**outnewlabs);
 
 void
 removesmallarea_relabel(long *in, unsigned char *byt, size_t size,
-                       size_t *numlabs, size_t minarea);
+                        size_t *numlabs, size_t minarea);
 
 void
 labindexs(long *lab, size_t size, size_t numlabs, size_t **outareas,
diff --git a/src/noisechisel/main.c b/src/noisechisel/main.c
index 5841d86..c3ef0fb 100644
--- a/src/noisechisel/main.c
+++ b/src/noisechisel/main.c
@@ -26,11 +26,11 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <stdlib.h>
 #include <progname.h>
 
-#include <gnuastro/timing.h>     /* Includes time.h and sys/time.h */
+#include <gnuastro/timing.h>    /* Includes time.h and sys/time.h */
 
 #include "main.h"
 
-#include "ui.h"                        /* needs main.h.                  */
+#include "ui.h"                 /* needs main.h.                  */
 #include "noisechisel.h"        /* needs main.h.                  */
 
 int
diff --git a/src/noisechisel/segmentation.c b/src/noisechisel/segmentation.c
index 4130d6d..95157da 100644
--- a/src/noisechisel/segmentation.c
+++ b/src/noisechisel/segmentation.c
@@ -166,7 +166,7 @@ thisdetectionisoneobject(struct clumpsthreadparams *ctp)
    is efficient. */
 void
 adjacencymatrixs(struct clumpsthreadparams *ctp,
-                double *sns, double *sums, int *nums)
+                 double *sns, double *sums, int *nums)
 {
   int rpnum;
   float *imgss=ctp->p->imgss;
@@ -183,38 +183,38 @@ adjacencymatrixs(struct clumpsthreadparams *ctp,
   do
     if( olab[*ind]==SEGMENTINIT && !isnan(imgss[*ind]) )
       {
-       /* Initialize the values to be used: */
-       ii=0;
-       rpnum=1;
-       rpave=imgss[*ind];
-       memset(wngb, 0, sizeof(wngb));
-
-       /* Find which grown clumps this river pixel touches.      */
-       GAL_NEIGHBORS_FILL_8_ALLIMG;
-       nf=(n=ngb)+numngb;
-       do
-         if( olab[*n]>0 )
-           {
+        /* Initialize the values to be used: */
+        ii=0;
+        rpnum=1;
+        rpave=imgss[*ind];
+        memset(wngb, 0, sizeof(wngb));
+
+        /* Find which grown clumps this river pixel touches.      */
+        GAL_NEIGHBORS_FILL_8_ALLIMG;
+        nf=(n=ngb)+numngb;
+        do
+          if( olab[*n]>0 )
+            {
               if(!isnan(imgss[*n])) /* Add the flux of this neighbor */
                 {                   /* pixel for finding the average */
                   ++rpnum;          /* of this river pixel later.    */
                   rpave+=imgss[*n];
                 }
-             for(i=0;i<ii;++i)
-               if(wngb[i]==olab[*n])
-                 break;
-             if(i==ii)             /* label not yet added to wngb.  */
-               {
-                 wngb[ii]=olab[*n];
-                 ++ii;
-               }
-           }
-       while(++n<nf);
-
-       /* If more than one neighboring label was found, fill in the
-          'sums' and 'nums' adjacency matrixs with the values for
-          this pixel. Recall that ii is the number of neighboring
-          labels to this river pixel. */
+              for(i=0;i<ii;++i)
+                if(wngb[i]==olab[*n])
+                  break;
+              if(i==ii)             /* label not yet added to wngb.  */
+                {
+                  wngb[ii]=olab[*n];
+                  ++ii;
+                }
+            }
+        while(++n<nf);
+
+        /* If more than one neighboring label was found, fill in the
+           'sums' and 'nums' adjacency matrixs with the values for
+           this pixel. Recall that ii is the number of neighboring
+           labels to this river pixel. */
         if(ii>1)
           {
             rpave/=rpnum;
@@ -235,26 +235,26 @@ adjacencymatrixs(struct clumpsthreadparams *ctp,
   for(i=0;i<numclumps;++i)
     for(j=0;j<i;++j)
       if( nums [ ii=i*numclumps+j ] ) /* There is a connection! */
-       {
-         ave = sums[ii]/nums[ii];
-         /* In case the average is nagive (only possible if sums is
-            negative), forget it. Note that even an area of 1 is
-            acceptable, and we put no area criteria here, because the
-            fact that a river exists between two clumps is
-            important. */
-         if( ave<0 )
-           {
-             nums[ii]=nums[j*numclumps+i]=0;
-             sums[ii]=sums[j*numclumps+i]=0;
-           }
-         /* Everything is ready, calculate the SN for this river:  */
-         else
-           /* Calculate the SN for this river and put it in both
-              sections of the SN adjacency matrix. Note that here we
-              want the average SN of the river, not the total. This
-              is why we haven't included the number of pixels. */
-           sns[ii] = sns[j*numclumps+i] = c * ave / sqrt(ave+err);
-       }
+        {
+          ave = sums[ii]/nums[ii];
+          /* In case the average is nagive (only possible if sums is
+             negative), forget it. Note that even an area of 1 is
+             acceptable, and we put no area criteria here, because the
+             fact that a river exists between two clumps is
+             important. */
+          if( ave<0 )
+            {
+              nums[ii]=nums[j*numclumps+i]=0;
+              sums[ii]=sums[j*numclumps+i]=0;
+            }
+          /* Everything is ready, calculate the SN for this river:  */
+          else
+            /* Calculate the SN for this river and put it in both
+               sections of the SN adjacency matrix. Note that here we
+               want the average SN of the river, not the total. This
+               is why we haven't included the number of pixels. */
+            sns[ii] = sns[j*numclumps+i] = c * ave / sqrt(ave+err);
+        }
 
   /* To check the matrix specific detected region:
   if(ctp->thislabel==104)
@@ -327,7 +327,7 @@ grownclumpstoobjects(struct clumpsthreadparams *ctp)
     for(j=1;j<i;++j)
       if( nums[ ii=i*numclumps+j ] < ctp->p->minriverlength
           || sns[ii] < ctp->p->objbordersn )
-       nums[ ii ] = nums[ j*numclumps+i ]=0;
+        nums[ ii ] = nums[ j*numclumps+i ]=0;
 
 
   /* Find the connected regions and assign new labels (starting
@@ -366,13 +366,14 @@ newclumplabels(struct clumpsthreadparams *ctp)
 
   /* A simple sanity check. */
   if(ctp->numclumps<=2 || ctp->numobjects<=2)
-    error(EXIT_FAILURE, 0, "a bug! Please contact us at %s so we can fix it. "
-          "For some reason, the newclumplabels function (in segmentation.c) "
-          "was called for the %lu detected region, even though this region "
-          "has ctp->numclumps=%lu and ctp->numobjects=%lu! This function "
-          "should only be used when there is more than one object and "
-          "clump over a detected region", PACKAGE_BUGREPORT,
-          ctp->thislabel, ctp->numclumps, ctp->numobjects);
+    error(EXIT_FAILURE, 0, "a bug! Please contact us at %s so we can fix "
+          "it. For some reason, the newclumplabels function (in "
+          "segmentation.c) was called for the %lu detected region, even "
+          "though this region has ctp->numclumps=%lu and "
+          "ctp->numobjects=%lu! This function should only be used when "
+          "there is more than one object and clump over a detected region",
+          PACKAGE_BUGREPORT, ctp->thislabel, ctp->numclumps,
+          ctp->numobjects);
 
   /* 'numclumpsinobj' will keep the number of clumps in each object.
      Unlike the numbers of objects and clumps, this is the actual
@@ -663,9 +664,9 @@ segmentdetections(struct noisechiselparams *p, size_t 
numobjsinit,
   else
     {
       /* Initialize the attributes. Note that this running thread
-        (that spinns off the nt threads) is also a thread, so the
-        number the barrier should be one more than the number of
-        threads spinned off. */
+         (that spinns off the nt threads) is also a thread, so the
+         number the barrier should be one more than the number of
+         threads spinned off. */
       if(numobjsinit<numthreads) nb=numobjsinit+1;
       else                       nb=numthreads+1;
       gal_threads_attr_barrier_init(&attr, &b, nb);
@@ -675,8 +676,8 @@ segmentdetections(struct noisechiselparams *p, size_t 
numobjsinit,
 
       /* Spin off the threads: */
       for(i=0;i<numthreads;++i)
-       if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
-         {
+        if(indexs[i*thrdcols]!=GAL_THREADS_NON_THRD_INDEX)
+          {
             ctp[i].p=p;
             ctp[i].id=i;
             ctp[i].b=&b;
@@ -684,9 +685,9 @@ segmentdetections(struct noisechiselparams *p, size_t 
numobjsinit,
             ctp[i].alllabinds=alllabinds;
             ctp[i].totalnummtx=&totalnummtx;
             ctp[i].indexs=&indexs[i*thrdcols];
-           err=pthread_create(&t, &attr, segmentonthread, &ctp[i]);
-           if(err) error(EXIT_FAILURE, 0, "can't create thread %lu", i);
-         }
+            err=pthread_create(&t, &attr, segmentonthread, &ctp[i]);
+            if(err) error(EXIT_FAILURE, 0, "can't create thread %lu", i);
+          }
 
       /* Wait for all threads to finish and free the spaces. */
       pthread_barrier_wait(&b);
diff --git a/src/noisechisel/ui.c b/src/noisechisel/ui.c
index 7043f6e..afa1971 100644
--- a/src/noisechisel/ui.c
+++ b/src/noisechisel/ui.c
@@ -30,10 +30,10 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <string.h>
 #include <fitsio.h>
 
-#include <nproc.h>              /* From Gnulib.                     */
+#include <nproc.h>               /* From Gnulib.                   */
 
 #include <gnuastro/fits.h>
-#include <gnuastro/timing.h>    /* includes time.h and sys/time.h   */
+#include <gnuastro/timing.h>     /* includes time.h and sys/time.h */
 #include <gnuastro/checkset.h>
 #include <gnuastro/txtarray.h>
 #include <gnuastro/commonargs.h>
@@ -43,8 +43,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* Needs main.h                   */
-#include "args.h"              /* Needs main.h, includes argp.h. */
+#include "ui.h"                  /* Needs main.h                   */
+#include "args.h"                /* Needs main.h, includes argp.h. */
 
 
 /* Set the file names of the places where the default parameters are
@@ -74,7 +74,7 @@ readconfig(char *filename, struct noisechiselparams *p)
   char *line, *name, *value;
   struct uiparams *up=&p->up;
   struct gal_commonparams *cp=&p->cp;
-  char key='a';        /* Not used, just a place holder. */
+  char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
      might be intentional, so there is no error. If a parameter is
@@ -91,7 +91,7 @@ readconfig(char *filename, struct noisechiselparams *p)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   /* Read the tokens in the file:  */
   while(getline(&line, &len, fp) != -1)
@@ -102,323 +102,323 @@ readconfig(char *filename, struct noisechiselparams *p)
 
       /* Inputs: */
       if(strcmp(name, "hdu")==0)
-       {
-         if(cp->hduset) continue;
-         errno=0;
-         cp->hdu=malloc(strlen(value)+1);
-         if(cp->hdu==NULL)
-           error(EXIT_FAILURE, errno, "space for HDU");
-         strcpy(cp->hdu, value);
-         cp->hduset=1;
-       }
+        {
+          if(cp->hduset) continue;
+          errno=0;
+          cp->hdu=malloc(strlen(value)+1);
+          if(cp->hdu==NULL)
+            error(EXIT_FAILURE, errno, "space for HDU");
+          strcpy(cp->hdu, value);
+          cp->hduset=1;
+        }
       else if(strcmp(name, "mask")==0)
-       {
-         if(up->masknameset) continue;
-         errno=0;
-         up->maskname=malloc(strlen(value)+1);
-         if(up->maskname==NULL)
-           error(EXIT_FAILURE, errno, "space for mask name");
-         strcpy(up->maskname, value);
-         up->masknameset=1;
-       }
+        {
+          if(up->masknameset) continue;
+          errno=0;
+          up->maskname=malloc(strlen(value)+1);
+          if(up->maskname==NULL)
+            error(EXIT_FAILURE, errno, "space for mask name");
+          strcpy(up->maskname, value);
+          up->masknameset=1;
+        }
       else if(strcmp(name, "mhdu")==0)
-       {
-         if(up->mhduset) continue;
-         errno=0;
-         up->mhdu=malloc(strlen(value)+1);
-         if(up->mhdu==NULL)
-           error(EXIT_FAILURE, errno, "space for mask HDU");
-         strcpy(up->mhdu, value);
-         up->mhduset=1;
-       }
+        {
+          if(up->mhduset) continue;
+          errno=0;
+          up->mhdu=malloc(strlen(value)+1);
+          if(up->mhdu==NULL)
+            error(EXIT_FAILURE, errno, "space for mask HDU");
+          strcpy(up->mhdu, value);
+          up->mhduset=1;
+        }
       else if(strcmp(name, "kernel")==0)
-       {
-         if(up->kernelnameset) continue;
-         errno=0;
-         up->kernelname=malloc(strlen(value)+1);
-         if(up->kernelname==NULL)
-           error(EXIT_FAILURE, errno, "space for kernel name");
-         strcpy(up->kernelname, value);
-         up->kernelnameset=1;
-       }
+        {
+          if(up->kernelnameset) continue;
+          errno=0;
+          up->kernelname=malloc(strlen(value)+1);
+          if(up->kernelname==NULL)
+            error(EXIT_FAILURE, errno, "space for kernel name");
+          strcpy(up->kernelname, value);
+          up->kernelnameset=1;
+        }
       else if(strcmp(name, "khdu")==0)
-       {
-         if(up->khduset) continue;
-         errno=0;
-         up->khdu=malloc(strlen(value)+1);
-         if(up->khdu==NULL)
-           error(EXIT_FAILURE, errno, "space for kernel HDU");
-         strcpy(up->khdu, value);
-         up->khduset=1;
-       }
+        {
+          if(up->khduset) continue;
+          errno=0;
+          up->khdu=malloc(strlen(value)+1);
+          if(up->khdu==NULL)
+            error(EXIT_FAILURE, errno, "space for kernel HDU");
+          strcpy(up->khdu, value);
+          up->khduset=1;
+        }
       else if(strcmp(name, "skysubtracted")==0)
-       {
-         if(up->skysubtractedset) continue;
-          gal_checkset_int_zero_or_one(value, &p->skysubtracted, name, key,
-                                       SPACK, filename, lineno);
-         up->skysubtractedset=1;
-       }
+        {
+          if(up->skysubtractedset) continue;
+          gal_checkset_int_zero_or_one(value, &p->skysubtracted, name,
+                                       key, SPACK, filename, lineno);
+          up->skysubtractedset=1;
+        }
       else if(strcmp(name, "minbfrac")==0)
-       {
-         if(up->minbfracset) continue;
-          gal_checkset_float_l_0_s_1(value, &p->minbfrac, name, key, SPACK,
-                                     filename, lineno);
-         up->minbfracset=1;
-       }
+        {
+          if(up->minbfracset) continue;
+          gal_checkset_float_l_0_s_1(value, &p->minbfrac, name,
+                                     key, SPACK, filename, lineno);
+          up->minbfracset=1;
+        }
       else if(strcmp(name, "minnumfalse")==0)
-       {
-         if(up->minnumfalseset) continue;
-          gal_checkset_sizet_l_zero(value, &p->minnumfalse, name, key, SPACK,
-                                    filename, lineno);
-         up->minnumfalseset=1;
-       }
+        {
+          if(up->minnumfalseset) continue;
+          gal_checkset_sizet_l_zero(value, &p->minnumfalse, name,
+                                    key, SPACK, filename, lineno);
+          up->minnumfalseset=1;
+        }
 
 
 
       /* Outputs */
       else if(strcmp(name, "output")==0)
-       {
-         if(cp->outputset) continue;
-         errno=0;
-         cp->output=malloc(strlen(value)+1);
-         if(cp->output==NULL)
-           error(EXIT_FAILURE, errno, "space for output");
-         strcpy(cp->output, value);
-         cp->outputset=1;
-       }
+        {
+          if(cp->outputset) continue;
+          errno=0;
+          cp->output=malloc(strlen(value)+1);
+          if(cp->output==NULL)
+            error(EXIT_FAILURE, errno, "space for output");
+          strcpy(cp->output, value);
+          cp->outputset=1;
+        }
       else if(strcmp(name, "grownclumps")==0)
-       {
-         if(up->grownclumpsset) continue;
-          gal_checkset_int_zero_or_one(value, &p->grownclumps, name, key, 
SPACK,
-                                       filename, lineno);
-         up->grownclumpsset=1;
-       }
+        {
+          if(up->grownclumpsset) continue;
+          gal_checkset_int_zero_or_one(value, &p->grownclumps, name,
+                                       key, SPACK, filename, lineno);
+          up->grownclumpsset=1;
+        }
 
 
       /* Mesh grid: */
       else if(strcmp(name, "smeshsize")==0)
-       {
-         if(up->smeshsizeset) continue;
-          gal_checkset_sizet_l_zero(value, &p->smp.meshsize, name, key, SPACK,
-                                    filename, lineno);
-         up->smeshsizeset=1;
-       }
+        {
+          if(up->smeshsizeset) continue;
+          gal_checkset_sizet_l_zero(value, &p->smp.meshsize, name,
+                                    key, SPACK, filename, lineno);
+          up->smeshsizeset=1;
+        }
       else if(strcmp(name, "lmeshsize")==0)
-       {
-         if(up->lmeshsizeset) continue;
-          gal_checkset_sizet_l_zero(value, &p->lmp.meshsize, name, key, SPACK,
-                                    filename, lineno);
-         up->lmeshsizeset=1;
-       }
+        {
+          if(up->lmeshsizeset) continue;
+          gal_checkset_sizet_l_zero(value, &p->lmp.meshsize, name,
+                                    key, SPACK, filename, lineno);
+          up->lmeshsizeset=1;
+        }
       else if(strcmp(name, "nch1")==0)
-       {
-         if(up->nch1set) continue;
-          gal_checkset_sizet_l_zero(value, &p->smp.nch1, name, key, SPACK,
-                                    filename, lineno);
-         up->nch1set=1;
-       }
+        {
+          if(up->nch1set) continue;
+          gal_checkset_sizet_l_zero(value, &p->smp.nch1, name, key,
+                                    SPACK, filename, lineno);
+          up->nch1set=1;
+        }
       else if(strcmp(name, "nch2")==0)
-       {
-         if(up->nch2set) continue;
-          gal_checkset_sizet_l_zero(value, &p->smp.nch2, name, key, SPACK,
-                                    filename, lineno);
-         up->nch2set=1;
-       }
+        {
+          if(up->nch2set) continue;
+          gal_checkset_sizet_l_zero(value, &p->smp.nch2, name, key,
+                                    SPACK, filename, lineno);
+          up->nch2set=1;
+        }
       else if(strcmp(name, "lastmeshfrac")==0)
-       {
-         if(up->lastmeshfracset) continue;
-          gal_checkset_float_l_0_s_1(value, &p->smp.lastmeshfrac, name, key,
-                                     SPACK, filename, lineno);
-         up->lastmeshfracset=1;
-       }
+        {
+          if(up->lastmeshfracset) continue;
+          gal_checkset_float_l_0_s_1(value, &p->smp.lastmeshfrac, name,
+                                     key, SPACK, filename, lineno);
+          up->lastmeshfracset=1;
+        }
       else if(strcmp(name, "mirrordist")==0)
-       {
-         if(up->mirrordistset) continue;
-          gal_checkset_float_l_0(value, &p->smp.mirrordist, name, key, SPACK,
-                                 filename, lineno);
-         up->mirrordistset=1;
-       }
+        {
+          if(up->mirrordistset) continue;
+          gal_checkset_float_l_0(value, &p->smp.mirrordist, name,
+                                 key, SPACK, filename, lineno);
+          up->mirrordistset=1;
+        }
       else if(strcmp(name, "minmodeq")==0)
-       {
-         if(up->minmodeqset) continue;
-          gal_checkset_float_l_0_s_1(value, &p->smp.minmodeq, name, key, SPACK,
-                                     filename, lineno);
-         up->minmodeqset=1;
-       }
+        {
+          if(up->minmodeqset) continue;
+          gal_checkset_float_l_0_s_1(value, &p->smp.minmodeq, name,
+                                     key, SPACK, filename, lineno);
+          up->minmodeqset=1;
+        }
       else if(strcmp(name, "numnearest")==0)
-       {
-         if(up->numnearestset) continue;
-          gal_checkset_sizet_l_zero(value, &p->smp.numnearest, name, key, 
SPACK,
-                                    filename, lineno);
-         up->numnearestset=1;
-       }
+        {
+          if(up->numnearestset) continue;
+          gal_checkset_sizet_l_zero(value, &p->smp.numnearest, name,
+                                    key, SPACK, filename, lineno);
+          up->numnearestset=1;
+        }
       else if(strcmp(name, "smoothwidth")==0)
-       {
-         if(up->smoothwidthset) continue;
-          gal_checkset_sizet_p_odd(value, &p->smp.smoothwidth, name, key, 
SPACK,
-                                   filename, lineno);
-         up->smoothwidthset=1;
-       }
+        {
+          if(up->smoothwidthset) continue;
+          gal_checkset_sizet_p_odd(value, &p->smp.smoothwidth, name,
+                                   key, SPACK, filename, lineno);
+          up->smoothwidthset=1;
+        }
       else if(strcmp(name, "fullconvolution")==0)
-       {
-         if(up->fullconvolutionset) continue;
-          gal_checkset_int_zero_or_one(value, &p->smp.fullconvolution, name,
-                                       key, SPACK, filename, lineno);
-         up->fullconvolutionset=1;
-       }
+        {
+          if(up->fullconvolutionset) continue;
+          gal_checkset_int_zero_or_one(value, &p->smp.fullconvolution,
+                                       name, key, SPACK, filename, lineno);
+          up->fullconvolutionset=1;
+        }
       else if(strcmp(name, "fullinterpolation")==0)
-       {
-         if(up->fullinterpolationset) continue;
-          gal_checkset_int_zero_or_one(value, &p->smp.fullinterpolation, name,
-                                       key, SPACK, filename, lineno);
-         up->fullinterpolationset=1;
-       }
+        {
+          if(up->fullinterpolationset) continue;
+          gal_checkset_int_zero_or_one(value, &p->smp.fullinterpolation,
+                                       name, key, SPACK, filename, lineno);
+          up->fullinterpolationset=1;
+        }
       else if(strcmp(name, "fullsmooth")==0)
-       {
-         if(up->fullsmoothset) continue;
+        {
+          if(up->fullsmoothset) continue;
           gal_checkset_int_zero_or_one(value, &p->smp.fullsmooth, name, key,
                                        SPACK, filename, lineno);
-         up->fullsmoothset=1;
-       }
+          up->fullsmoothset=1;
+        }
 
 
       /* Detection: */
       else if(strcmp(name, "qthresh")==0)
-       {
-         if(up->qthreshset) continue;
-          gal_checkset_float_l_0_s_1(value, &p->qthresh, name, key, SPACK,
-                                     filename, lineno);
-         up->qthreshset=1;
-       }
+        {
+          if(up->qthreshset) continue;
+          gal_checkset_float_l_0_s_1(value, &p->qthresh, name, key,
+                                     SPACK, filename, lineno);
+          up->qthreshset=1;
+        }
       else if(strcmp(name, "erode")==0)
-       {
-         if(up->erodeset) continue;
-          gal_checkset_sizet_el_zero(value, &p->erode, name, key, SPACK,
-                                     filename, lineno);
-         up->erodeset=1;
-       }
+        {
+          if(up->erodeset) continue;
+          gal_checkset_sizet_el_zero(value, &p->erode, name, key,
+                                     SPACK, filename, lineno);
+          up->erodeset=1;
+        }
       else if(strcmp(name, "erodengb")==0)
-       {
-         if(up->erodengbset) continue;
-          gal_checkset_int_4_or_8(value, &p->erodengb, name, key, SPACK,
-                                  filename, lineno);
-         up->erodengbset=1;
-       }
+        {
+          if(up->erodengbset) continue;
+          gal_checkset_int_4_or_8(value, &p->erodengb, name, key,
+                                  SPACK, filename, lineno);
+          up->erodengbset=1;
+        }
       else if(strcmp(name, "opening")==0)
-       {
-         if(up->openingset) continue;
-          gal_checkset_sizet_el_zero(value, &p->opening, name, key, SPACK,
-                                     filename, lineno);
-         up->openingset=1;
-       }
+        {
+          if(up->openingset) continue;
+          gal_checkset_sizet_el_zero(value, &p->opening, name, key,
+                                     SPACK, filename, lineno);
+          up->openingset=1;
+        }
       else if(strcmp(name, "openingngb")==0)
-       {
-         if(up->openingngbset) continue;
-          gal_checkset_int_4_or_8(value, &p->openingngb, name, key, SPACK,
-                                  filename, lineno);
-         up->openingngbset=1;
-       }
+        {
+          if(up->openingngbset) continue;
+          gal_checkset_int_4_or_8(value, &p->openingngb, name,
+                                  key, SPACK, filename, lineno);
+          up->openingngbset=1;
+        }
       else if(strcmp(name, "sigclipmultip")==0)
-       {
-         if(up->sigclipmultipset) continue;
-          gal_checkset_float_l_0(value, &p->sigclipmultip, name, key, SPACK,
-                                 filename, lineno);
-         up->sigclipmultipset=1;
-       }
+        {
+          if(up->sigclipmultipset) continue;
+          gal_checkset_float_l_0(value, &p->sigclipmultip, name,
+                                 key, SPACK, filename, lineno);
+          up->sigclipmultipset=1;
+        }
       else if(strcmp(name, "sigcliptolerance")==0)
-       {
-         if(up->sigcliptoleranceset) continue;
-          gal_checkset_float_l_0_s_1(value, &p->sigcliptolerance, name, key,
-                                     SPACK, filename, lineno);
-         up->sigcliptoleranceset=1;
-       }
+        {
+          if(up->sigcliptoleranceset) continue;
+          gal_checkset_float_l_0_s_1(value, &p->sigcliptolerance, name,
+                                     key, SPACK, filename, lineno);
+          up->sigcliptoleranceset=1;
+        }
       else if(strcmp(name, "dthresh")==0)
-       {
-         if(up->dthreshset) continue;
-          gal_checkset_any_float(value, &p->dthresh, name, key, SPACK,
-                                 filename, lineno);
-         up->dthreshset=1;
-       }
+        {
+          if(up->dthreshset) continue;
+          gal_checkset_any_float(value, &p->dthresh, name, key,
+                                 SPACK, filename, lineno);
+          up->dthreshset=1;
+        }
       else if(strcmp(name, "detsnminarea")==0)
-       {
-         if(up->detsnminareaset) continue;
-          gal_checkset_sizet_l_zero(value, &p->detsnminarea, name, key, SPACK,
-                                    filename, lineno);
-         up->detsnminareaset=1;
-       }
+        {
+          if(up->detsnminareaset) continue;
+          gal_checkset_sizet_l_zero(value, &p->detsnminarea, name,
+                                    key, SPACK, filename, lineno);
+          up->detsnminareaset=1;
+        }
       else if(strcmp(name, "detsnhistnbins")==0)
-       {
-         if(up->detsnhistnbinsset) continue;
-          gal_checkset_sizet_el_zero(value, &p->detsnhistnbins, name, key,
-                                     SPACK, filename, lineno);
-         up->detsnhistnbinsset=1;
-       }
+        {
+          if(up->detsnhistnbinsset) continue;
+          gal_checkset_sizet_el_zero(value, &p->detsnhistnbins, name,
+                                     key, SPACK, filename, lineno);
+          up->detsnhistnbinsset=1;
+        }
       else if(strcmp(name, "detquant")==0)
-       {
-         if(up->detquantset) continue;
-          gal_checkset_float_l_0_s_1(value, &p->detquant, name, key, SPACK,
-                                     filename, lineno);
-         up->detquantset=1;
-       }
+        {
+          if(up->detquantset) continue;
+          gal_checkset_float_l_0_s_1(value, &p->detquant, name, key,
+                                     SPACK, filename, lineno);
+          up->detquantset=1;
+        }
       else if(strcmp(name, "dilate")==0)
-       {
-         if(up->dilateset) continue;
-          gal_checkset_sizet_el_zero(value, &p->dilate, name, key, SPACK,
-                                     filename, lineno);
-         up->dilateset=1;
-       }
+        {
+          if(up->dilateset) continue;
+          gal_checkset_sizet_el_zero(value, &p->dilate, name, key,
+                                     SPACK, filename, lineno);
+          up->dilateset=1;
+        }
 
 
       /* Segmentation: */
       else if(strcmp(name, "segsnminarea")==0)
-       {
-         if(up->segsnminareaset) continue;
-          gal_checkset_sizet_l_zero(value, &p->segsnminarea, name, key, SPACK,
-                                    filename, lineno);
-         up->segsnminareaset=1;
-       }
+        {
+          if(up->segsnminareaset) continue;
+          gal_checkset_sizet_l_zero(value, &p->segsnminarea, name,
+                                    key, SPACK, filename, lineno);
+          up->segsnminareaset=1;
+        }
       else if(strcmp(name, "keepmaxnearriver")==0)
-       {
-         if(up->keepmaxnearriverset) continue;
-          gal_checkset_int_zero_or_one(value, &p->keepmaxnearriver, name, key,
-                                       SPACK, filename, lineno);
-         up->keepmaxnearriverset=1;
-       }
+        {
+          if(up->keepmaxnearriverset) continue;
+          gal_checkset_int_zero_or_one(value, &p->keepmaxnearriver, name,
+                                       key, SPACK, filename, lineno);
+          up->keepmaxnearriverset=1;
+        }
       else if(strcmp(name, "segquant")==0)
-       {
-         if(up->segquantset) continue;
-          gal_checkset_float_l_0_s_1(value, &p->segquant, name, key, SPACK,
-                                     filename, lineno);
-         up->segquantset=1;
-       }
+        {
+          if(up->segquantset) continue;
+          gal_checkset_float_l_0_s_1(value, &p->segquant, name, key,
+                                     SPACK, filename, lineno);
+          up->segquantset=1;
+        }
       else if(strcmp(name, "clumpsnhistnbins")==0)
-       {
-         if(up->clumpsnhistnbinsset) continue;
-          gal_checkset_sizet_el_zero(value, &p->clumpsnhistnbins, name, key,
-                                     SPACK,filename, lineno);
-         up->clumpsnhistnbinsset=1;
-       }
+        {
+          if(up->clumpsnhistnbinsset) continue;
+          gal_checkset_sizet_el_zero(value, &p->clumpsnhistnbins, name,
+                                     key, SPACK,filename, lineno);
+          up->clumpsnhistnbinsset=1;
+        }
       else if(strcmp(name, "gthresh")==0)
-       {
-         if(up->gthreshset) continue;
+        {
+          if(up->gthreshset) continue;
           gal_checkset_any_float(value, &p->gthresh, name, key, SPACK,
                                  filename, lineno);
-         up->gthreshset=1;
-       }
+          up->gthreshset=1;
+        }
       else if(strcmp(name, "minriverlength")==0)
-       {
-         if(up->minriverlengthset) continue;
-          gal_checkset_sizet_l_zero(value, &p->minriverlength, name, key, 
SPACK,
-                                    filename, lineno);
-         up->minriverlengthset=1;
-       }
+        {
+          if(up->minriverlengthset) continue;
+          gal_checkset_sizet_l_zero(value, &p->minriverlength, name,
+                                    key, SPACK, filename, lineno);
+          up->minriverlengthset=1;
+        }
       else if(strcmp(name, "objbordersn")==0)
-       {
-         if(up->objbordersnset) continue;
-          gal_checkset_float_l_0(value, &p->objbordersn, name, key, SPACK,
-                                 filename, lineno);
-         up->objbordersnset=1;
-       }
+        {
+          if(up->objbordersnset) continue;
+          gal_checkset_float_l_0(value, &p->objbordersn, name, key,
+                                 SPACK, filename, lineno);
+          up->objbordersnset=1;
+        }
 
 
       /* Operating modes: */
@@ -427,8 +427,8 @@ readconfig(char *filename, struct noisechiselparams *p)
 
 
       else
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     "`%s` not recognized.\n", name);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      "`%s` not recognized.\n", name);
     }
 
   free(line);
diff --git a/src/subtractsky/args.h b/src/subtractsky/args.h
index 7d1bb72..d072b02 100644
--- a/src/subtractsky/args.h
+++ b/src/subtractsky/args.h
@@ -330,9 +330,9 @@ parse_opt(int key, char *arg, struct argp_state *state)
      user is warned and the program is stopped: */
   if(arg && arg[0]=='=')
     argp_error(state, "incorrect use of the equal sign (`=`). For short "
-              "options, `=` should not be used and for long options, "
-              "there should be no space between the option, equal sign "
-              "and value");
+               "options, `=` should not be used and for long options, "
+               "there should be no space between the option, equal sign "
+               "and value");
 
   switch(key)
     {
@@ -452,7 +452,7 @@ parse_opt(int key, char *arg, struct argp_state *state)
             argp_error(state, "only one input image should be given");
           else
             p->up.inputname=arg;
-       }
+        }
       else
         argp_error(state, "%s is not a valid file type", arg);
       break;
@@ -464,13 +464,13 @@ parse_opt(int key, char *arg, struct argp_state *state)
     /* The command line options and arguments are finished. */
     case ARGP_KEY_END:
       if(p->cp.setdirconf==0 && p->cp.setusrconf==0
-        && p->cp.printparams==0)
-       {
-         if(state->arg_num==0)
-           argp_error(state, "no argument given");
-         if(p->up.inputname==NULL)
-           argp_error(state, "no input FITS image(s) provided");
-       }
+         && p->cp.printparams==0)
+        {
+          if(state->arg_num==0)
+            argp_error(state, "no argument given");
+          if(p->up.inputname==NULL)
+            argp_error(state, "no input FITS image(s) provided");
+        }
       break;
 
 
@@ -500,6 +500,6 @@ struct argp_child children[]=
 
 /* Basic structure defining the whole argument reading process. */
 static struct argp thisargp = {options, parse_opt, args_doc,
-                              doc, children, NULL, NULL};
+                               doc, children, NULL, NULL};
 
 #endif
diff --git a/src/subtractsky/cite.h b/src/subtractsky/cite.h
index f010378..866153d 100644
--- a/src/subtractsky/cite.h
+++ b/src/subtractsky/cite.h
@@ -25,14 +25,14 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #define SUBTRACTSKYBIBTEX ""
 
-#define PRINTCITEABORT {                                               \
-    printf("\nWe hope %s has been useful for your research.\n"         \
-          "Citations are vital for the continued work on %s.\n"        \
-          "Thank you for citing it in your research paper.\n"          \
-          "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
-          SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
-           GAL_STRINGS_MAIN_BIBTEX, SUBTRACTSKYBIBTEX);                        
\
-    exit(EXIT_SUCCESS);                                                        
\
+#define PRINTCITEABORT {                                                \
+    printf("\nWe hope %s has been useful for your research.\n"          \
+           "Citations are vital for the continued work on %s.\n"        \
+           "Thank you for citing it in your research paper.\n"          \
+           "\nPlease cite as \"%s\":\n\n%s\n\n%s",                      \
+           SPACK_NAME, SPACK_NAME, SPACK_STRING,                        \
+           GAL_STRINGS_MAIN_BIBTEX, SUBTRACTSKYBIBTEX);                 \
+    exit(EXIT_SUCCESS);                                                 \
 }
 
 #endif
diff --git a/src/subtractsky/main.c b/src/subtractsky/main.c
index c444d1d..d4ea567 100644
--- a/src/subtractsky/main.c
+++ b/src/subtractsky/main.c
@@ -30,7 +30,7 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* needs main.h.                  */
+#include "ui.h"                 /* needs main.h.                  */
 #include "subtractsky.h"        /* needs main.h.                  */
 
 int
diff --git a/src/subtractsky/ui.c b/src/subtractsky/ui.c
index 6fda917..d73f9e5 100644
--- a/src/subtractsky/ui.c
+++ b/src/subtractsky/ui.c
@@ -30,10 +30,10 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 #include <string.h>
 #include <fitsio.h>
 
-#include <nproc.h>              /* From Gnulib.                     */
+#include <nproc.h>               /* From Gnulib.                   */
 
 #include <gnuastro/fits.h>
-#include <gnuastro/timing.h>           /* Includes time.h and sys/time.h   */
+#include <gnuastro/timing.h>     /* Includes time.h and sys/time.h */
 #include <gnuastro/checkset.h>
 #include <gnuastro/txtarray.h>
 #include <gnuastro/statistics.h>
@@ -43,8 +43,8 @@ along with Gnuastro. If not, see 
<http://www.gnu.org/licenses/>.
 
 #include "main.h"
 
-#include "ui.h"                        /* Needs main.h                   */
-#include "args.h"              /* Needs main.h, includes argp.h. */
+#include "ui.h"                  /* Needs main.h                   */
+#include "args.h"                /* Needs main.h, includes argp.h. */
 
 
 /* Set the file names of the places where the default parameters are
@@ -74,7 +74,7 @@ readconfig(char *filename, struct subtractskyparams *p)
   char *line, *name, *value;
   struct uiparams *up=&p->up;
   struct gal_commonparams *cp=&p->cp;
-  char key='a';        /* Not used, just a place holder. */
+  char key='a';        /* Not used, just a place holder. */
 
   /* When the file doesn't exist or can't be opened, it is ignored. It
      might be intentional, so there is no error. If a parameter is
@@ -91,7 +91,7 @@ readconfig(char *filename, struct subtractskyparams *p)
   line=malloc(len*sizeof *line);
   if(line==NULL)
     error(EXIT_FAILURE, errno, "ui.c: %lu bytes in readdefaults",
-         len * sizeof *line);
+          len * sizeof *line);
 
   /* Read the tokens in the file:  */
   while(getline(&line, &len, fp) != -1)
@@ -102,166 +102,166 @@ readconfig(char *filename, struct subtractskyparams *p)
 
       /* Inputs: */
       if(strcmp(name, "hdu")==0)
-       {
-         if(cp->hduset) continue;
-         errno=0;
-         cp->hdu=malloc(strlen(value)+1);
-         if(cp->hdu==NULL)
-           error(EXIT_FAILURE, errno, "space for HDU");
-         strcpy(cp->hdu, value);
-         cp->hduset=1;
-       }
+        {
+          if(cp->hduset) continue;
+          errno=0;
+          cp->hdu=malloc(strlen(value)+1);
+          if(cp->hdu==NULL)
+            error(EXIT_FAILURE, errno, "space for HDU");
+          strcpy(cp->hdu, value);
+          cp->hduset=1;
+        }
       else if(strcmp(name, "mask")==0)
-       {
-         if(up->masknameset) continue;
-         errno=0;
-         up->maskname=malloc(strlen(value)+1);
-         if(up->maskname==NULL)
-           error(EXIT_FAILURE, errno, "space for mask name");
-         strcpy(up->maskname, value);
-         up->masknameset=1;
-       }
+        {
+          if(up->masknameset) continue;
+          errno=0;
+          up->maskname=malloc(strlen(value)+1);
+          if(up->maskname==NULL)
+            error(EXIT_FAILURE, errno, "space for mask name");
+          strcpy(up->maskname, value);
+          up->masknameset=1;
+        }
       else if(strcmp(name, "mhdu")==0)
-       {
-         if(up->mhduset) continue;
-         errno=0;
-         up->mhdu=malloc(strlen(value)+1);
-         if(up->mhdu==NULL)
-           error(EXIT_FAILURE, errno, "space for mask HDU");
-         strcpy(up->mhdu, value);
-         up->mhduset=1;
-       }
+        {
+          if(up->mhduset) continue;
+          errno=0;
+          up->mhdu=malloc(strlen(value)+1);
+          if(up->mhdu==NULL)
+            error(EXIT_FAILURE, errno, "space for mask HDU");
+          strcpy(up->mhdu, value);
+          up->mhduset=1;
+        }
       else if(strcmp(name, "kernel")==0)
-       {
-         if(up->kernelnameset) continue;
-         errno=0;
-         up->kernelname=malloc(strlen(value)+1);
-         if(up->kernelname==NULL)
-           error(EXIT_FAILURE, errno, "space for kernel name");
-         strcpy(up->kernelname, value);
-         up->kernelnameset=1;
-       }
+        {
+          if(up->kernelnameset) continue;
+          errno=0;
+          up->kernelname=malloc(strlen(value)+1);
+          if(up->kernelname==NULL)
+            error(EXIT_FAILURE, errno, "space for kernel name");
+          strcpy(up->kernelname, value);
+          up->kernelnameset=1;
+        }
       else if(strcmp(name, "khdu")==0)
-       {
-         if(up->khduset) continue;
-         errno=0;
-         up->khdu=malloc(strlen(value)+1);
-         if(up->khdu==NULL)
-           error(EXIT_FAILURE, errno, "mpace for kernel HDU");
-         strcpy(up->khdu, value);
-         up->khduset=1;
-       }
+        {
+          if(up->khduset) continue;
+          errno=0;
+          up->khdu=malloc(strlen(value)+1);
+          if(up->khdu==NULL)
+            error(EXIT_FAILURE, errno, "mpace for kernel HDU");
+          strcpy(up->khdu, value);
+          up->khduset=1;
+        }
 
 
 
       /* Outputs */
       else if(strcmp(name, "output")==0)
-       {
-         if(cp->outputset) continue;
-         errno=0;
-         cp->output=malloc(strlen(value)+1);
-         if(cp->output==NULL)
-           error(EXIT_FAILURE, errno, "space for output");
-         strcpy(cp->output, value);
-         cp->outputset=1;
-       }
+        {
+          if(cp->outputset) continue;
+          errno=0;
+          cp->output=malloc(strlen(value)+1);
+          if(cp->output==NULL)
+            error(EXIT_FAILURE, errno, "space for output");
+          strcpy(cp->output, value);
+          cp->outputset=1;
+        }
 
 
       /* Mesh grid: */
       else if(strcmp(name, "meshsize")==0)
-       {
-         if(up->meshsizeset) continue;
-          gal_checkset_sizet_l_zero(value, &p->mp.meshsize, name, key, SPACK,
-                                    filename, lineno);
-         up->meshsizeset=1;
-       }
+        {
+          if(up->meshsizeset) continue;
+          gal_checkset_sizet_l_zero(value, &p->mp.meshsize, name,
+                                    key, SPACK, filename, lineno);
+          up->meshsizeset=1;
+        }
       else if(strcmp(name, "nch1")==0)
-       {
-         if(up->nch1set) continue;
+        {
+          if(up->nch1set) continue;
           gal_checkset_sizet_l_zero(value, &p->mp.nch1, name, key, SPACK,
                                     filename, lineno);
-         up->nch1set=1;
-       }
+          up->nch1set=1;
+        }
       else if(strcmp(name, "nch2")==0)
-       {
-         if(up->nch2set) continue;
+        {
+          if(up->nch2set) continue;
           gal_checkset_sizet_l_zero(value, &p->mp.nch2, name, key, SPACK,
                                     filename, lineno);
-         up->nch2set=1;
-       }
+          up->nch2set=1;
+        }
       else if(strcmp(name, "lastmeshfrac")==0)
-       {
-         if(up->lastmeshfracset) continue;
-          gal_checkset_float_l_0_s_1(value, &p->mp.lastmeshfrac, name, key, 
SPACK,
-                                     filename, lineno);
-         up->lastmeshfracset=1;
-       }
+        {
+          if(up->lastmeshfracset) continue;
+          gal_checkset_float_l_0_s_1(value, &p->mp.lastmeshfrac, name,
+                                     key, SPACK, filename, lineno);
+          up->lastmeshfracset=1;
+        }
       else if(strcmp(name, "mirrordist")==0)
-       {
-         if(up->mirrordistset) continue;
-          gal_checkset_float_l_0(value, &p->mp.mirrordist, name, key, SPACK,
-                                 filename, lineno);
-         up->mirrordistset=1;
-       }
+        {
+          if(up->mirrordistset) continue;
+          gal_checkset_float_l_0(value, &p->mp.mirrordist, name, key,
+                                 SPACK, filename, lineno);
+          up->mirrordistset=1;
+        }
       else if(strcmp(name, "minmodeq")==0)
-       {
-         if(up->minmodeqset) continue;
-          gal_checkset_float_l_0_s_1(value, &p->mp.minmodeq, name, key, SPACK,
-                                     filename, lineno);
-         up->minmodeqset=1;
-       }
+        {
+          if(up->minmodeqset) continue;
+          gal_checkset_float_l_0_s_1(value, &p->mp.minmodeq, name, key,
+                                     SPACK, filename, lineno);
+          up->minmodeqset=1;
+        }
       else if(strcmp(name, "numnearest")==0)
-       {
-         if(up->numnearestset) continue;
-          gal_checkset_sizet_l_zero(value, &p->mp.numnearest, name, key, SPACK,
-                                    filename, lineno);
-         up->numnearestset=1;
-       }
+        {
+          if(up->numnearestset) continue;
+          gal_checkset_sizet_l_zero(value, &p->mp.numnearest, name,
+                                    key, SPACK, filename, lineno);
+          up->numnearestset=1;
+        }
       else if(strcmp(name, "smoothwidth")==0)
-       {
-         if(up->smoothwidthset) continue;
-          gal_checkset_sizet_p_odd(value, &p->mp.smoothwidth, name, key, SPACK,
-                                   filename, lineno);
-         up->smoothwidthset=1;
-       }
+        {
+          if(up->smoothwidthset) continue;
+          gal_checkset_sizet_p_odd(value, &p->mp.smoothwidth, name,
+                                   key, SPACK, filename, lineno);
+          up->smoothwidthset=1;
+        }
       else if(strcmp(name, "fullconvolution")==0)
-       {
-         if(up->fullconvolutionset) continue;
-          gal_checkset_int_zero_or_one(value, &p->mp.fullconvolution, name, 
key,
-                                       SPACK, filename, lineno);
-         up->fullconvolutionset=1;
-       }
+        {
+          if(up->fullconvolutionset) continue;
+          gal_checkset_int_zero_or_one(value, &p->mp.fullconvolution,
+                                       name, key, SPACK, filename, lineno);
+          up->fullconvolutionset=1;
+        }
       else if(strcmp(name, "fullinterpolation")==0)
-       {
-         if(up->fullinterpolationset) continue;
-          gal_checkset_int_zero_or_one(value, &p->mp.fullinterpolation, name,
-                                       key, SPACK, filename, lineno);
-         up->fullinterpolationset=1;
-       }
+        {
+          if(up->fullinterpolationset) continue;
+          gal_checkset_int_zero_or_one(value, &p->mp.fullinterpolation,
+                                       name, key, SPACK, filename, lineno);
+          up->fullinterpolationset=1;
+        }
       else if(strcmp(name, "fullsmooth")==0)
-       {
-         if(up->fullsmoothset) continue;
+        {
+          if(up->fullsmoothset) continue;
           gal_checkset_int_zero_or_one(value, &p->mp.fullsmooth, name, key,
                                        SPACK, filename, lineno);
-         up->fullsmoothset=1;
-       }
+          up->fullsmoothset=1;
+        }
 
 
       /* Statistics: */
       else if(strcmp(name, "sigclipmultip")==0)
-       {
-         if(up->sigclipmultipset) continue;
-          gal_checkset_float_l_0(value, &p->sigclipmultip, name, key, SPACK,
-                                 filename, lineno);
-         up->sigclipmultipset=1;
-       }
+        {
+          if(up->sigclipmultipset) continue;
+          gal_checkset_float_l_0(value, &p->sigclipmultip, name, key,
+                                 SPACK, filename, lineno);
+          up->sigclipmultipset=1;
+        }
       else if(strcmp(name, "sigcliptolerance")==0)
-       {
-         if(up->sigcliptoleranceset) continue;
-          gal_checkset_float_l_0_s_1(value, &p->sigcliptolerance, name, key,
-                                     SPACK, filename, lineno);
-         up->sigcliptoleranceset=1;
-       }
+        {
+          if(up->sigcliptoleranceset) continue;
+          gal_checkset_float_l_0_s_1(value, &p->sigcliptolerance, name,
+                                     key, SPACK, filename, lineno);
+          up->sigcliptoleranceset=1;
+        }
 
 
       /* Operating modes: */
@@ -270,8 +270,8 @@ readconfig(char *filename, struct subtractskyparams *p)
 
 
       else
-       error_at_line(EXIT_FAILURE, 0, filename, lineno,
-                     "`%s` not recognized.\n", name);
+        error_at_line(EXIT_FAILURE, 0, filename, lineno,
+                      "`%s` not recognized.\n", name);
     }
 
   free(line);
@@ -295,37 +295,37 @@ printvalues(FILE *fp, struct subtractskyparams *p)
   if(cp->hduset)
     {
       if(gal_checkset_string_has_space(cp->hdu))
-       fprintf(fp, CONF_SHOWFMT"\"%s\"\n", "hdu", cp->hdu);
+        fprintf(fp, CONF_SHOWFMT"\"%s\"\n", "hdu", cp->hdu);
       else
-       fprintf(fp, CONF_SHOWFMT"%s\n", "hdu", cp->hdu);
+        fprintf(fp, CONF_SHOWFMT"%s\n", "hdu", cp->hdu);
     }
   if(up->masknameset)
     {
       if(gal_checkset_string_has_space(up->maskname))
-       fprintf(fp, CONF_SHOWFMT"\"%s\"\n", "mask", up->maskname);
+        fprintf(fp, CONF_SHOWFMT"\"%s\"\n", "mask", up->maskname);
       else
-       fprintf(fp, CONF_SHOWFMT"%s\n", "mask", up->maskname);
+        fprintf(fp, CONF_SHOWFMT"%s\n", "mask", up->maskname);
     }
   if(up->mhdu)
     {
       if(gal_checkset_string_has_space(up->mhdu))
-       fprintf(fp, CONF_SHOWFMT"\"%s\"\n", "mhdu", up->mhdu);
+        fprintf(fp, CONF_SHOWFMT"\"%s\"\n", "mhdu", up->mhdu);
       else
-       fprintf(fp, CONF_SHOWFMT"%s\n", "mhdu", up->mhdu);
+        fprintf(fp, CONF_SHOWFMT"%s\n", "mhdu", up->mhdu);
     }
   if(up->kernelnameset)
     {
       if(gal_checkset_string_has_space(up->kernelname))
-       fprintf(fp, CONF_SHOWFMT"\"%s\"\n", "kernel", up->kernelname);
+        fprintf(fp, CONF_SHOWFMT"\"%s\"\n", "kernel", up->kernelname);
       else
-       fprintf(fp, CONF_SHOWFMT"%s\n", "kernel", up->kernelname);
+        fprintf(fp, CONF_SHOWFMT"%s\n", "kernel", up->kernelname);
     }
   if(up->khdu)
     {
       if(gal_checkset_string_has_space(up->khdu))
-       fprintf(fp, CONF_SHOWFMT"\"%s\"\n", "khdu", up->khdu);
+        fprintf(fp, CONF_SHOWFMT"\"%s\"\n", "khdu", up->khdu);
       else
-       fprintf(fp, CONF_SHOWFMT"%s\n", "khdu", up->khdu);
+        fprintf(fp, CONF_SHOWFMT"%s\n", "khdu", up->khdu);
     }
 
 
@@ -458,8 +458,8 @@ sanitycheck(struct subtractskyparams *p)
 
   /* Set the maskname and mask hdu accordingly: */
   gal_fits_file_or_ext_name(p->up.inputname, p->cp.hdu, p->up.masknameset,
-                                 &p->up.maskname, p->up.mhdu, p->up.mhduset,
-                                 "mask");
+                            &p->up.maskname, p->up.mhdu, p->up.mhduset,
+                            "mask");
 
   /* Set the output name: */
   if(p->cp.output)
@@ -497,8 +497,8 @@ sanitycheck(struct subtractskyparams *p)
 
   /* Other checks: */
   if(p->mp.numnearest<GAL_MESH_MIN_ACCEPTABLE_NEAREST)
-    error(EXIT_FAILURE, 0, "the smallest possible number for `--numnearest' "
-          "(`-n') is %d. You have asked for: %lu",
+    error(EXIT_FAILURE, 0, "the smallest possible number for "
+          "`--numnearest' (`-n') is %d. You have asked for: %lu",
           GAL_MESH_MIN_ACCEPTABLE_NEAREST, p->mp.numnearest);
 
   /* Set the constants in the gal_mesh_params structure. */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]