diff --git a/coders/dib.c b/coders/dib.c
index 29f03b4..5bbda7e 100644
--- a/coders/dib.c
+++ b/coders/dib.c
@@ -483,6 +483,7 @@
     *p;
 
   size_t
+    bytes_per_line,
     length;
 
   ssize_t
@@ -491,9 +492,6 @@
   unsigned char
     *pixels;
 
-  size_t
-    bytes_per_line;
-
   /*
     Open image file.
   */
@@ -660,7 +658,6 @@
           {
             index=(IndexPacket) ((*p) & (0x80 >> bit) ? 0x01 : 0x00);
             SetIndexPixelComponent(indexes+x+bit,index);
-            *q++=image->colormap[(ssize_t) index];
           }
           p++;
         }
@@ -670,7 +667,6 @@
             {
               index=(IndexPacket) ((*p) & (0x80 >> bit) ? 0x01 : 0x00);
               SetIndexPixelComponent(indexes+x+bit,index);
-              *q++=image->colormap[(ssize_t) index];
             }
             p++;
           }
@@ -684,6 +680,7 @@
               break;
           }
       }
+      (void) SyncImage(image);
       break;
     }
     case 4:
@@ -701,18 +698,15 @@
         for (x=0; x < ((ssize_t) image->columns-1); x+=2)
         {
           index=ConstrainColormapIndex(image,(*p >> 4) & 0xf);
-          indexes[x]=index;
-          *q++=image->colormap[(ssize_t) index];
+          SetIndexPixelComponent(indexes+x,index);
           index=ConstrainColormapIndex(image,*p & 0xf);
-          indexes[x+1]=index;
-          *q++=image->colormap[(ssize_t) index];
+          SetIndexPixelComponent(indexes+x+1,index);
           p++;
         }
         if ((image->columns % 2) != 0)
           {
             index=ConstrainColormapIndex(image,(*p >> 4) & 0xf);
-            indexes[x]=index;
-            *q++=image->colormap[(ssize_t) index];
+            SetIndexPixelComponent(indexes+x,index);
             p++;
           }
         if (SyncAuthenticPixels(image,exception) == MagickFalse)
@@ -725,6 +719,7 @@
               break;
           }
       }
+      (void) SyncImage(image);
       break;
     }
     case 8:
@@ -745,8 +740,7 @@
         for (x=0; x < (ssize_t) image->columns; x++)
         {
           index=ConstrainColormapIndex(image,*p);
-          indexes[x]=index;
-          *q=image->colormap[(ssize_t) index];
+          SetIndexPixelComponent(indexes+x,index);
           p++;
           q++;
         }
@@ -760,6 +754,7 @@
               break;
           }
       }
+      (void) SyncImage(image);
       break;
     }
     case 16:
@@ -785,21 +780,21 @@
           word|=(*p++ << 8);
           if (dib_info.red_mask == 0)
             {
-              q->red=ScaleCharToQuantum(ScaleColor5to8((unsigned char)
-                ((word >> 10) & 0x1f)));
-              q->green=ScaleCharToQuantum(ScaleColor5to8((unsigned char)
-                ((word >> 5) & 0x1f)));
-              q->blue=ScaleCharToQuantum(ScaleColor5to8((unsigned char)
-                (word & 0x1f)));
+              SetRedPixelComponent(q,ScaleCharToQuantum(ScaleColor5to8(
+                (unsigned char) ((word >> 10) & 0x1f))));
+              SetGreenPixelComponent(q,ScaleCharToQuantum(ScaleColor5to8(
+                (unsigned char) ((word >> 5) & 0x1f))));
+              SetBluePixelComponent(q,ScaleCharToQuantum(ScaleColor5to8(
+                (unsigned char) (word & 0x1f))));
             }
           else
             {
-              q->red=ScaleCharToQuantum(ScaleColor5to8((unsigned char)
-                ((word >> 11) & 0x1f)));
-              q->green=ScaleCharToQuantum(ScaleColor6to8((unsigned char)
-                ((word >> 5) & 0x3f)));
-              q->blue=ScaleCharToQuantum(ScaleColor5to8((unsigned char)
-                (word & 0x1f)));
+              SetRedPixelComponent(q,ScaleCharToQuantum(ScaleColor5to8(
+                (unsigned char) ((word >> 11) & 0x1f))));
+              SetGreenPixelComponent(q,ScaleCharToQuantum(ScaleColor6to8(
+                (unsigned char) ((word >> 5) & 0x3f))));
+              SetBluePixelComponent(q,ScaleCharToQuantum(ScaleColor5to8(
+                (unsigned char) (word & 0x1f))));
             }
           q++;
         }
@@ -970,9 +965,6 @@
   DIBInfo
     dib_info;
 
-  ssize_t
-    y;
-
   MagickBooleanType
     status;
 
@@ -989,13 +981,16 @@
   register unsigned char
     *q;
 
+  size_t
+    bytes_per_line;
+
+  ssize_t
+    y;
+
   unsigned char
     *dib_data,
     *pixels;
 
-  size_t
-    bytes_per_line;
-
   /*
     Open output image file.
   */
@@ -1092,7 +1087,7 @@
         for (x=0; x < (ssize_t) image->columns; x++)
         {
           byte<<=1;
-          byte|=indexes[x] != 0 ? 0x01 : 0x00;
+          byte|=GetIndexPixelComponent(indexes+x) != 0 ? 0x01 : 0x00;
           bit++;
           if (bit == 8)
             {
@@ -1110,7 +1105,7 @@
         for (x=(ssize_t) (image->columns+7)/8; x < (ssize_t) bytes_per_line; x++)
           *q++=0x00;
         status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
-                image->rows);
+          image->rows);
         if (status == MagickFalse)
           break;
       }
@@ -1133,7 +1128,7 @@
         for ( ; x < (ssize_t) bytes_per_line; x++)
           *q++=0x00;
         status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
-                image->rows);
+          image->rows);
         if (status == MagickFalse)
           break;
       }
@@ -1155,9 +1150,11 @@
         for (x=0; x < (ssize_t) image->columns; x++)
         {
           word=(unsigned short) ((ScaleColor8to5((unsigned char)
-            ScaleQuantumToChar(GetRedPixelComponent(p))) << 11) | (ScaleColor8to6((unsigned char)
-            ScaleQuantumToChar(GetGreenPixelComponent(p))) << 5) | (ScaleColor8to5(
-            (unsigned char) ScaleQuantumToChar((unsigned char) GetBluePixelComponent(p)) << 0)));
+            ScaleQuantumToChar(GetRedPixelComponent(p))) << 11) |
+            (ScaleColor8to6((unsigned char) ScaleQuantumToChar(
+            GetGreenPixelComponent(p))) << 5) | (ScaleColor8to5((unsigned char)
+            ScaleQuantumToChar((unsigned char) GetBluePixelComponent(p)) <<
+            0)));
           *q++=(unsigned char)(word & 0xff);
           *q++=(unsigned char)(word >> 8);
           p++;
@@ -1165,7 +1162,7 @@
         for (x=(ssize_t) (2*image->columns); x < (ssize_t) bytes_per_line; x++)
           *q++=0x00;
         status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
-                image->rows);
+          image->rows);
         if (status == MagickFalse)
           break;
       }
@@ -1196,7 +1193,7 @@
           for (x=(ssize_t) (3*image->columns); x < (ssize_t) bytes_per_line; x++)
             *q++=0x00;
         status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
-                image->rows);
+          image->rows);
         if (status == MagickFalse)
           break;
       }
diff --git a/coders/djvu.c b/coders/djvu.c
index a4626c9..5d8cb66 100644
--- a/coders/djvu.c
+++ b/coders/djvu.c
@@ -407,7 +407,7 @@
                                         {
                                                 if (bit == 0) byte= (size_t) q[(y * stride) + (x / 8)];
 
-                                                indexes[x]=(IndexPacket) (((byte & 0x01) != 0) ? 0x00 : 0x01);
+                                                SetIndexPixelComponent(indexes+x,(IndexPacket) (((byte & 0x01) != 0) ? 0x00 : 0x01));
                                                 bit++;
                                                 if (bit == 8)
                                                         bit=0;
diff --git a/coders/dng.c b/coders/dng.c
index 9d57285..a5664ba 100644
--- a/coders/dng.c
+++ b/coders/dng.c
@@ -160,7 +160,7 @@
       if (xml != (char *) NULL)
         {
           XMLTreeInfo
-           *ufraw;
+            *ufraw;
 
           /*
             Inject 
diff --git a/coders/dps.c b/coders/dps.c
index f4e8028..e1ec23f 100644
--- a/coders/dps.c
+++ b/coders/dps.c
@@ -117,10 +117,6 @@
     sans,
     status;
 
-  ssize_t
-    x,
-    y;
-
   Pixmap
     pixmap;
 
@@ -139,6 +135,10 @@
   Screen
     *screen;
 
+  ssize_t
+    x,
+    y;
+
   XColor
     *colors;
 
@@ -382,11 +382,11 @@
           {
             pixel=XGetPixel(dps_image,x,y);
             index=(pixel >> red_shift) & red_mask;
-            q->red=ScaleShortToQuantum(colors[index].red);
+            SetRedPixelComponent(q,ScaleShortToQuantum(colors[index].red));
             index=(pixel >> green_shift) & green_mask;
-            q->green=ScaleShortToQuantum(colors[index].green);
+            SetGreenPixelComponent(q,ScaleShortToQuantum(colors[index].green));
             index=(pixel >> blue_shift) & blue_mask;
-            q->blue=ScaleShortToQuantum(colors[index].blue);
+            SetBluePixelComponent(q,ScaleShortToQuantum(colors[index].blue));
             q++;
           }
           if (SyncAuthenticPixels(image,exception) == MagickFalse)
@@ -405,13 +405,15 @@
             pixel=XGetPixel(dps_image,x,y);
             color=(pixel >> red_shift) & red_mask;
             color=(color*65535L)/red_mask;
-            q->red=ScaleShortToQuantum((unsigned short) color);
+            SetRedPixelComponent(q,ScaleShortToQuantum((unsigned short) color));
             color=(pixel >> green_shift) & green_mask;
             color=(color*65535L)/green_mask;
-            q->green=ScaleShortToQuantum((unsigned short) color);
+            SetGreenPixelComponent(q,ScaleShortToQuantum((unsigned short)
+              color));
             color=(pixel >> blue_shift) & blue_mask;
             color=(color*65535L)/blue_mask;
-            q->blue=ScaleShortToQuantum((unsigned short) color);
+            SetBluePixelComponent(q,ScaleShortToQuantum((unsigned short)
+              color));
             q++;
           }
           if (SyncAuthenticPixels(image,exception) == MagickFalse)
@@ -453,7 +455,8 @@
           break;
         indexes=GetAuthenticIndexQueue(image);
         for (x=0; x < (ssize_t) image->columns; x++)
-          indexes[x]=(unsigned short) XGetPixel(dps_image,x,y);
+          SetIndexPixelComponent(indexes+x,(unsigned short)
+            XGetPixel(dps_image,x,y));
         if (SyncAuthenticPixels(image,exception) == MagickFalse)
           break;
         if (SetImageProgress(image,LoadImageTag,y,image->rows) == MagickFalse)
@@ -500,7 +503,7 @@
                 {
                   SetOpacityPixelComponent(q,OpaqueOpacity);
                   if (XGetPixel(matte_image,x,y) == 0)
-                    q->opacity=TransparentOpacity;
+                    SetOpacityPixelComponent(q,TransparentOpacity);
                   q++;
                 }
                 if (SyncAuthenticPixels(image,exception) == MagickFalse)
diff --git a/coders/xtrn.c b/coders/xtrn.c
index caea89b..6c0d5f7 100644
--- a/coders/xtrn.c
+++ b/coders/xtrn.c
@@ -378,6 +378,7 @@
     {
       /* Adjust the length of the buffer to fit */
     }
+  }
   return(tlen);
 }