diff --git a/autogen.sh b/autogen.sh
index 016649719e6fb073bd59455205ebdd77fb504ca0..698e4e56128a384dc4ee5cc5a30063368aac050d 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -34,6 +34,14 @@ for OPT in "$@"; do
 			AMVERSION=$arg
 			;;
 	-h|--help) usage ; exit 0 ;;
+	*)
+            if test -d "$OPT/m4"; then
+              ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I $OPT/m4"
+            fi
+            if test -d "$OPT/am"; then
+              am_dir="$OPT/am"
+            fi
+            ;;
     esac
 done
 
diff --git a/m4/dune.m4 b/m4/dune.m4
index d26f438f92dedb8594d62664ab5491f4bfe1ffb6..c7432df544bc18a3abe821d686f9c5227641ba08 100644
--- a/m4/dune.m4
+++ b/m4/dune.m4
@@ -64,9 +64,10 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
   ## check for lib (if lib name was provided)
   ifelse(_dune_lib,,[echo _dune_module does not provide libs],[
     # did we find the headers?
-    if test x$HAVE[]_DUNE_MODULE = x1 ; then
+    if test x$HAVE_[]_DUNE_MODULE = x1 ; then
       ac_save_LDFLAGS="$LDFLAGS"
       ac_save_LIBS="$LIBS"
+      HAVE[]_DUNE_MODULE=0
 
       ## special test for a local installation
       if test x$_DUNE_MODULE[]ROOT != x ; then
@@ -87,7 +88,7 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
       fi
 
       ## normal test for a systemwide install
-      if test x$HAVE[]_DUNE_MODULE = x0 ; then
+      if test x$HAVE_[]_DUNE_MODULE = x0 ; then
          # !!! should be pkg-config later (which would save the special
          # header-check as well)
 
@@ -101,6 +102,10 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
           )
       fi
 
+      if test x$_DUNE_MODULE[]_LIBS = x; then
+        AC_MSG_ERROR([failed to find lib[]_dune_lib[] needed of module _dune_module])
+      fi
+
       # reset variables
       LDFLAGS="$ac_save_LDFLAGS"
       LIBS="$ac_save_LIBS"
@@ -125,6 +130,8 @@ AC_DEFUN([DUNE_CHECK_MODULES],[
     DUNE_PKG_CPPFLAGS="$DUNE_PKG_CPPFLAGS $DUNE_CPPFLAGS"
     DUNE_PKG_LIBS="$DUNE_PKG_LIBS $LIBS"
     DUNE_PKG_LDFLAGS="$DUNE_PKG_LDFLAGS $DUNE_LDFLAGS"
+  else
+    AC_MSG_ERROR([could not find required module _dune_module])
   fi
 
   # reset previous flags
@@ -143,7 +150,7 @@ AC_DEFUN([DUNE_CHECK_DISPATCH],[
            DUNE_CHECK_MODULES([dunegrid], [grid/common/grid.hh], [grid], [grid], [Dune::PartitionName])],
          [$1], [duneistl],[
            DUNE_CHECK_MODULES([duneistl], [istl/allocator.hh],,,)],
-         [$1], [dunedist],[
+         [$1], [dunedisc],[
            DUNE_CHECK_MODULES([dunedisc], [disc/functions/functions.hh], [disc], [disc], [Dune::LagrangeShapeFunctions<double, double, 3>::general])],
          [AC_MSG_ERROR([Unknown module $1])])
 ])
diff --git a/m4/dune_all.m4 b/m4/dune_all.m4
index 1c11ce80475bede540c3d6f592ef2257457bc518..0ee5c197d36b1120ddfd38b682bba463ca0054ae 100644
--- a/m4/dune_all.m4
+++ b/m4/dune_all.m4
@@ -173,7 +173,6 @@ AC_SUBST(revision, $with_revision)
 
   AC_REQUIRE([DUNE_MODULE_DEPENDENCIES])
   echo "Resolving Dependencies: $@"
-  echo "Resolving Dependencies: shift($@)"
   DUNE_MODULE_DEPENDENCIES($@)
   AC_REQUIRE([DUNE_CHECK_ALL])
   AC_REQUIRE([DUNE_DEV_MODE])