Applied modified version of second patch for bug #642939.
Original patch supplied by Nelson A. de Oliveira. Modified to not use the -1 "insanity" for invalid/none layer ID's in scripts per IRC discussion. Additional scripts were changed to not pass -1 to gimp-image-insert-layer.
Showing with 130 additions and 130 deletions