diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c
index b985258..5114977 100644
--- a/MagickCore/enhance.c
+++ b/MagickCore/enhance.c
@@ -1155,7 +1155,7 @@
         Stretch-contrast colormap.
       */
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
-  #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+      #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
 #endif
       for (j=0; j < (ssize_t) image->colors; j++)
       {
@@ -1163,33 +1163,33 @@
           {
             i=GetPixelChannelMapChannel(image,RedPixelChannel);
             if (black[i] != white[i])
-              image->colormap[i].red=ClampToQuantum(stretch_map[
+              image->colormap[j].red=ClampToQuantum(stretch_map[
                 GetPixelChannels(image)*ScaleQuantumToMap(
-                image->colormap[i].red)]+i);
+                image->colormap[j].red)]+i);
           }
         if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
           {
             i=GetPixelChannelMapChannel(image,GreenPixelChannel);
             if (black[i] != white[i])
-              image->colormap[i].red=ClampToQuantum(stretch_map[
+              image->colormap[j].green=ClampToQuantum(stretch_map[
                 GetPixelChannels(image)*ScaleQuantumToMap(
-                image->colormap[i].red)]+i);
+                image->colormap[j].green)]+i);
           }
         if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
           {
             i=GetPixelChannelMapChannel(image,BluePixelChannel);
             if (black[i] != white[i])
-              image->colormap[i].red=ClampToQuantum(stretch_map[
+              image->colormap[j].blue=ClampToQuantum(stretch_map[
                 GetPixelChannels(image)*ScaleQuantumToMap(
-                image->colormap[i].red)]+i);
+                image->colormap[j].blue)]+i);
           }
         if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
           {
             i=GetPixelChannelMapChannel(image,AlphaPixelChannel);
             if (black[i] != white[i])
-              image->colormap[i].red=ClampToQuantum(stretch_map[
+              image->colormap[j].alpha=ClampToQuantum(stretch_map[
                 GetPixelChannels(image)*ScaleQuantumToMap(
-                image->colormap[i].red)]+i);
+                image->colormap[j].alpha)]+i);
           }
       }
     }