diff --git a/configure.ac b/configure.ac
index db9b6e9..a0ee6bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,6 +89,12 @@ esac
 AC_MSG_RESULT([$platform_win32])
 AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
 
+dnl Check the compiler vendor. This is needed to run some tests that break
+dnl on AIX and Tru64. To be conservative, currently only run those tests
+dnl when compiling with GCC.
+AC_CXX_COMPILER_VENDOR([compiler_vendor])
+AM_CONDITIONAL(COMPILER_GCC, test "$compiler_vendor" = "gnu")
+
 dnl Using libtool
 AC_CONFIG_MACRO_DIR(scripts)
 AC_LIBTOOL_WIN32_DLL
diff --git a/scripts/_ac_c_ifdef.m4 b/scripts/_ac_c_ifdef.m4
new file mode 100644
index 0000000..80fa546
--- /dev/null
+++ b/scripts/_ac_c_ifdef.m4
@@ -0,0 +1,29 @@
+# ===========================================================================
+#           http://www.nongnu.org/autoconf-archive/_ac_c_ifdef.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   _AC_C_IFDEF(MACRO-NAME, ACTION-IF-DEF, ACTION-IF-NOT-DEF)
+#
+# DESCRIPTION
+#
+#   Check for the definition of macro MACRO-NAME using the current
+#   language's compiler.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Ludovic Courtes <ludo@chbouib.org>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.
+
+AC_DEFUN([_AC_C_IFDEF],
+  [AC_COMPILE_IFELSE([#ifndef $1
+                      # error "Macro $1 is undefined!"
+		      /* For some compilers (eg. SGI's CC), #error is not
+		         enough...  */
+		      please, do fail
+		      #endif],
+		     [$2], [$3])])
diff --git a/scripts/ac_cxx_compiler_vendor.m4 b/scripts/ac_cxx_compiler_vendor.m4
new file mode 100644
index 0000000..5d41ec2
--- /dev/null
+++ b/scripts/ac_cxx_compiler_vendor.m4
@@ -0,0 +1,65 @@
+# ===========================================================================
+#     http://www.nongnu.org/autoconf-archive/ac_cxx_compiler_vendor.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AC_CXX_COMPILER_VENDOR(VENDOR-NAME, [NICKNAME])
+#
+# DESCRIPTION
+#
+#   Set VENDOR-NAME to the lower-case name of the compiler vendor or
+#   `unknown' if the compiler's vendor is unknown. `compaq' means the CXX
+#   compiler as available on Tru64/OSF1/Digital Unix on Alpha machines. If
+#   NICKNAME is provided, set it to the compiler's usual name (eg. `g++',
+#   `cxx', `aCC', etc.).
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Ludovic Courtes <ludo@chbouib.org>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.
+
+AC_DEFUN([AC_CXX_COMPILER_VENDOR],
+  [AC_REQUIRE([AC_PROG_CXX])
+   AC_REQUIRE([AC_PROG_CXXCPP])
+   AC_CACHE_CHECK([the C++ compiler vendor],
+    [ac_cv_cxx_compiler_vendor],
+
+    [AC_LANG_PUSH([C++])
+
+     dnl GNU C++
+     _AC_C_IFDEF([__GNUG__],
+       [ac_cv_cxx_compiler_vendor=gnu],
+       [_AC_C_IFDEF([__DECCXX],
+	 [ac_cv_cxx_compiler_vendor=compaq],
+	 [dnl HP's aCC
+	  _AC_C_IFDEF([__HP_aCC],
+	   [ac_cv_cxx_compiler_vendor=hp],
+	   [dnl SGI CC
+	    _AC_C_IFDEF([__sgi],
+	     [ac_cv_cxx_compiler_vendor=sgi],
+	     [dnl Note:  We are using the C compiler because VC++ doesn't
+	      dnl recognize `.cc'(which is used by `configure') as a C++ file
+	      dnl extension and requires `/TP' to be passed.
+	      AC_LANG_PUSH([C])
+	      _AC_C_IFDEF([_MSC_VER],
+		[ac_cv_cxx_compiler_vendor=microsoft],
+		[ac_cv_cxx_compiler_vendor=unknown])
+	      AC_LANG_POP()])])])])
+
+     AC_LANG_POP()])
+   $1="$ac_cv_cxx_compiler_vendor"
+
+   dnl The compiler nickname
+   ifelse([$2], , [],
+     [case "$ac_cv_cxx_compiler_vendor" in
+	gnu)       $2=g++;;
+	compaq)    $2=cxx;;
+	hp)        $2=aCC;;
+	sgi)       $2=CC;;
+	microsoft) $2=cl;;
+	*)         $2=unknown;;
+      esac])])dnl
diff --git a/sigc++/macros/signal.h.m4 b/sigc++/macros/signal.h.m4
index cc03a9e..6c72b29 100644
--- a/sigc++/macros/signal.h.m4
+++ b/sigc++/macros/signal.h.m4
@@ -31,8 +31,8 @@ struct signal_emit$1
   typedef signal_emit$1<LIST(T_return, LOOP(T_arg%1, $1), T_accumulator)> self_type;
   typedef typename T_accumulator::result_type result_type;
   typedef slot<LIST(T_return, LOOP(T_arg%1, $1))> slot_type;
-  typedef internal::slot_iterator_buf<self_type> slot_iterator_buf_type;
-  typedef internal::slot_reverse_iterator_buf<self_type> slot_reverse_iterator_buf_type;
+  typedef internal::slot_iterator_buf<self_type, T_return> slot_iterator_buf_type;
+  typedef internal::slot_reverse_iterator_buf<self_type, T_return> slot_reverse_iterator_buf_type;
   typedef signal_impl::const_iterator_type iterator_type;
 
 ifelse($1,0,,[dnl
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 52e54e3..de6a711 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -31,8 +31,18 @@ noinst_PROGRAMS= \
   test_custom \
   test_accum_iter
 
-#Disabled:
+# those two tests are only enabled if the compiler is GCC
+# see explanation below
+if COMPILER_GCC
+noinst_PROGRAMS += \
+  test_accumulated
+endif
+
+#Those tests are only run on GCC:
 #   test_lambda - The Tru64 compiler can't build this when not using -std strict_ansi -model ansi, so let's not worry about it.
+# Addendum 2009-06-19: it doesn't seem to work at all even in GCC, and emits two errors like this:
+# test_lambda.cc:78:   instantiated from here
+# ../sigc++/adaptors/lambda/operator.h:444: error: conversion from ‘int’ to non-scalar type ‘sigc::reference_wrapper<int>’ requested
 
 #  test_accumulated - The AIX xlC compiler can't build this. It says 
 #  xlC_r  -I. -I. -I.. -I.. -I..    -AA -c -o test_accumulated.o test_accumulated.cc
@@ -49,7 +59,6 @@ test_mem_fun_SOURCES = test_mem_fun.cc
 test_ptr_fun_SOURCES = test_ptr_fun.cc
 test_slot_SOURCES = test_slot.cc
 test_signal_SOURCES = test_signal.cc
-# test_accumulated_SOURCES = test_accumulated.cc
 test_disconnect_SOURCES = test_disconnect.cc
 test_disconnect_during_emit_SOURCES = test_disconnect_during_emit.cc
 test_bind_SOURCES = test_bind.cc
@@ -60,7 +69,6 @@ test_hide_SOURCES = test_hide.cc
 test_retype_SOURCES = test_retype.cc
 test_compose_SOURCES = test_compose.cc
 test_exception_catch_SOURCES = test_exception_catch.cc
-# test_lambda_SOURCES = test_lambda.cc
 
 test_size_SOURCES = test_size.cc
 test_limit_reference_SOURCES = test_limit_reference.cc
@@ -68,3 +76,8 @@ test_copy_invalid_slot_SOURCES = test_copy_invalid_slot.cc
 test_slot_disconnect_SOURCES = test_slot_disconnect.cc
 test_custom_SOURCES = test_custom.cc
 test_accum_iter_SOURCES = test_accum_iter.cc
+
+if COMPILER_GCC
+test_accumulated_SOURCES = test_accumulated.cc
+#test_lambda_SOURCES = test_lambda.cc
+endif
diff --git a/tests/test_accumulated.cc b/tests/test_accumulated.cc
index 24e5f2c..e20ead6 100644
--- a/tests/test_accumulated.cc
+++ b/tests/test_accumulated.cc
@@ -8,6 +8,7 @@
 #include <sigc++/functors/ptr_fun.h>
 #include <sigc++/functors/mem_fun.h>
 #include <iostream>
+#include <vector>
 
 SIGC_USING_STD(cout)
 SIGC_USING_STD(endl)
@@ -26,6 +27,20 @@ struct arithmetic_mean_accumulator
     }
 };
 
+template<class Ret>
+struct vector_accumulator
+{
+  typedef std::vector<Ret> result_type;
+  template<typename T_iterator>
+  result_type operator()(T_iterator first, T_iterator last) const
+    {
+      result_type vec;
+      for (; first != last; ++first)
+        vec.push_back(*first);
+      return vec;
+    }
+};
+
 int foo(int i)    { std::cout << "foo: " << 3*i+1 << std::endl; return 3*i+1;}
 int bar(double i) { std::cout << "bar: " << 5*int(i)-3 << std::endl; return 5*int(i)-3;}
 
@@ -37,14 +52,36 @@ struct A : public sigc::trackable
 int main()
 {
    sigc::signal<int,int>::accumulated<arithmetic_mean_accumulator> sig;
+   sigc::signal<int,int>::accumulated<vector_accumulator<int> > sig_vec;
 
    std::cout << "Result (empty slot list): " << sig(0) << std::endl;
+   std::cout << "Vector result (empty slot list): "
+             << (sig_vec(0).empty() ? "empty" : "not empty") << std::endl;
 
    A a;
    sig.connect(sigc::ptr_fun1(&foo));
    sig.connect(sigc::mem_fun1(&a, &A::foo));
    sig.connect(sigc::ptr_fun1(&bar));
+   
+   sig_vec.connect(sigc::ptr_fun1(&foo));
+   sig_vec.connect(sigc::mem_fun1(&a, &A::foo));
+   sig_vec.connect(sigc::ptr_fun1(&bar));
 
-   std::cout << "Result (i=1): " << sig(1) << std::endl;
-   std::cout << "Result (i=11): " << sig(11) << std::endl;
+   std::cout << "Mean accumulator: Result (i=1): " << sig(1) << std::endl;
+   std::cout << "Mean accumulator: Plain Result (i=11): " << sig(11) << std::endl;
+   
+   std::vector<int> res1 = sig_vec(1);
+   std::vector<int> res3 = sig_vec(3);
+   
+   std::cout << "Vector accumulator: Result (i=1): ";
+   for (std::vector<int>::iterator i = res1.begin(); i != res1.end(); ++i)
+     std::cout << *i << " ";
+   std::cout << std::endl;
+   
+   std::cout << "Vector accumulator: Result (i=3): ";
+   for (std::vector<int>::iterator i = res3.begin(); i != res3.end(); ++i)
+     std::cout << *i << " ";
+   std::cout << std::endl;
+   
+   return 0;
 }
