--- gimp-2.6.7/app/paint/gimpheal.c	2008-09-25 20:00:14.000000000 +0200
+++ app/paint/gimpheal.c	2009-10-16 16:25:40.000000000 +0200
@@ -309,7 +309,7 @@ gimp_heal_laplace_iteration (gdouble *ma
       for (j = 0; j < width; j++)
         {
           if ((0 == *mask) || (i == 0) || (i == (height - 1)) ||
-              (j == 0) || (j == (height - 1)))
+              (j == 0) || (j == (width - 1)))
             {
               /* do nothing at the boundary or outside mask */
               for (k = 0; k < depth; k++)
@@ -436,6 +436,7 @@ gimp_heal_motion (GimpSourceCore   *sour
   GimpImageType  src_type;
   TempBuf       *mask_buf;
   gdouble        hardness;
+  gboolean       has_alpha;
 
   hardness = gimp_paint_options_get_dynamic_hardness (paint_options,
                                                       &paint_core->cur_coords);
@@ -491,16 +492,39 @@ gimp_heal_motion (GimpSourceCore   *sour
    * is perhaps counter-intutitive?
    */
 
-  pixel_region_init (&origPR, gimp_drawable_get_tiles (drawable),
-                     paint_area->x, paint_area->y,
-                     paint_area->width, paint_area->height, FALSE);
+  if ( ! GIMP_SOURCE_OPTIONS (paint_options)->sample_merged)
+    {
+      pixel_region_init (&origPR, gimp_drawable_get_tiles (drawable),
+                         paint_area->x, paint_area->y,
+                         paint_area->width, paint_area->height, FALSE);
+
+      has_alpha = gimp_drawable_has_alpha (drawable);
+    }
+  else
+    {
+      GimpImage      *image = gimp_item_get_image (GIMP_ITEM (drawable));
+      GimpProjection *proj  = gimp_image_get_projection (image);
+      TempBuf        *orig;
+
+      orig = gimp_paint_core_get_orig_proj (GIMP_PAINT_CORE (source_core),
+                                            GIMP_PICKABLE (proj),
+                                            paint_area->x, paint_area->y,
+                                            paint_area->x + paint_area->width, 
+                                            paint_area->y + paint_area->height);
+
+      pixel_region_init_temp_buf (&origPR, orig,
+                                  0, 0,
+                                  paint_area->width, paint_area->height);
+
+      has_alpha = ! (orig->bytes & 1);
+    }
 
   temp = temp_buf_new (origPR.w, origPR.h,
                        gimp_drawable_bytes_with_alpha (drawable),
                        0, 0, NULL);
   pixel_region_init_temp_buf (&tempPR, temp, 0, 0, temp->width, temp->height);
 
-  if (gimp_drawable_has_alpha (drawable))
+  if (has_alpha)
     copy_region (&origPR, &tempPR);
   else
     add_alpha_region (&origPR, &tempPR);
