diff --git a/test/block.cpp b/test/block.cpp
index f7529dd..2c28253 100644
--- a/test/block.cpp
+++ b/test/block.cpp
@@ -113,15 +113,15 @@
   VERIFY_IS_EQUAL( (m1.block(r1,c1,rows-r1,cols-c1).block(r2-r1,c2-c1,rows-r2,cols-c2)) , (m1.block(r2,c2,rows-r2,cols-c2)) );
   VERIFY_IS_EQUAL( (m1.block(r1,c1,r2-r1+1,c2-c1+1).row(0)) , (m1.row(r1).segment(c1,c2-c1+1)) );
   VERIFY_IS_EQUAL( (m1.block(r1,c1,r2-r1+1,c2-c1+1).col(0)) , (m1.col(c1).segment(r1,r2-r1+1)) );
-  VERIFY_IS_EQUAL( (m1.block(r1,c1,r2-r1+1,c2-c1+1).transpose().col(0)) , (m1.row(r1).segment(c1,c2-c1+1)) );
-  VERIFY_IS_EQUAL( (m1.transpose().block(c1,r1,c2-c1+1,r2-r1+1).col(0)) , (m1.row(r1).segment(c1,c2-c1+1)) );
+  VERIFY_IS_EQUAL( (m1.block(r1,c1,r2-r1+1,c2-c1+1).transpose().col(0)) , (m1.row(r1).segment(c1,c2-c1+1)).transpose() );
+  VERIFY_IS_EQUAL( (m1.transpose().block(c1,r1,c2-c1+1,r2-r1+1).col(0)) , (m1.row(r1).segment(c1,c2-c1+1)).transpose() );
 
   // expressions without direct access
   VERIFY_IS_EQUAL( ((m1+m2).block(r1,c1,rows-r1,cols-c1).block(r2-r1,c2-c1,rows-r2,cols-c2)) , ((m1+m2).block(r2,c2,rows-r2,cols-c2)) );
   VERIFY_IS_EQUAL( ((m1+m2).block(r1,c1,r2-r1+1,c2-c1+1).row(0)) , ((m1+m2).row(r1).segment(c1,c2-c1+1)) );
   VERIFY_IS_EQUAL( ((m1+m2).block(r1,c1,r2-r1+1,c2-c1+1).col(0)) , ((m1+m2).col(c1).segment(r1,r2-r1+1)) );
-  VERIFY_IS_EQUAL( ((m1+m2).block(r1,c1,r2-r1+1,c2-c1+1).transpose().col(0)) , ((m1+m2).row(r1).segment(c1,c2-c1+1)) );
-  VERIFY_IS_EQUAL( ((m1+m2).transpose().block(c1,r1,c2-c1+1,r2-r1+1).col(0)) , ((m1+m2).row(r1).segment(c1,c2-c1+1)) );
+  VERIFY_IS_EQUAL( ((m1+m2).block(r1,c1,r2-r1+1,c2-c1+1).transpose().col(0)) , ((m1+m2).row(r1).segment(c1,c2-c1+1)).transpose() );
+  VERIFY_IS_EQUAL( ((m1+m2).transpose().block(c1,r1,c2-c1+1,r2-r1+1).col(0)) , ((m1+m2).row(r1).segment(c1,c2-c1+1)).transpose() );
 
   // evaluation into plain matrices from expressions with direct access (stress MapBase)
   DynamicMatrixType dm;
diff --git a/test/main.h b/test/main.h
index 0c0381f..d1a68be 100644
--- a/test/main.h
+++ b/test/main.h
@@ -69,6 +69,7 @@
     // case the exception is not properly caught.
     // This may happen when a second exceptions is raise in a destructor.
     static bool no_more_assert = false;
+    static bool report_on_cerr_on_assert_failure = true;
 
     struct ei_assert_exception
     {
@@ -94,7 +95,8 @@
 
     #define ei_assert(a)                       \
       if( (!(a)) && (!no_more_assert) )     \
-      {                                     \
+      { \
+        if(report_on_cerr_on_assert_failure) \
           std::cerr <<  #a << " " __FILE__ << "(" << __LINE__ << ")\n"; \
         Eigen::no_more_assert = true;       \
         throw Eigen::ei_assert_exception(); \
@@ -110,7 +112,9 @@
         try {                                                                     \
           Eigen::ei_assert_list.clear();                                          \
           Eigen::ei_push_assert = true;                                           \
+          Eigen::report_on_cerr_on_assert_failure = false;                        \
           a;                                                                      \
+          Eigen::report_on_cerr_on_assert_failure = true;                         \
           Eigen::ei_push_assert = false;                                          \
           std::cerr << "One of the following asserts should have been raised:\n"; \
           for (uint ai=0 ; ai<ei_assert_list.size() ; ++ai)                       \
@@ -127,13 +131,19 @@
       if( (!(a)) && (!no_more_assert) )     \
       {                                     \
         Eigen::no_more_assert = true;       \
+        if(report_on_cerr_on_assert_failure) \
           std::cerr <<  #a << " " __FILE__ << "(" << __LINE__ << ")\n"; \
         throw Eigen::ei_assert_exception(); \
       }
 
     #define VERIFY_RAISES_ASSERT(a) {                             \
         Eigen::no_more_assert = false;                            \
-        try { a; VERIFY(Eigen::should_raise_an_assert && # a); }  \
+        try { \
+          Eigen::report_on_cerr_on_assert_failure = false;                        \
+          a; \
+          Eigen::report_on_cerr_on_assert_failure = true;                        \
+          VERIFY(Eigen::should_raise_an_assert && # a); \
+        }  \
         catch (Eigen::ei_assert_exception e) { VERIFY(true); }    \
       }
 
@@ -357,46 +367,8 @@
   return m.isUnitary(test_precision<typename ei_traits<Derived>::Scalar>());
 }
 
-template<typename Derived1, typename Derived2,
-         bool IsVector = bool(Derived1::IsVectorAtCompileTime) && bool(Derived2::IsVectorAtCompileTime) >
-struct test_is_equal_impl
-{
-  static bool run(const Derived1& a1, const Derived2& a2)
-  {
-    if(a1.size() == 0 && a2.size() == 0) return true;
-    if(a1.size() != a2.size()) return false;
-    // we evaluate a2 into a temporary of the shape of a1. this allows to let Assign.h handle the transposing if needed.
-    typename Derived1::PlainObject a2_evaluated(a2.size());
-    a2_evaluated(0,0) = a2(0,0); // shut up GCC 4.5.0 bogus warning about a2_evaluated's array being used uninitialized in the 1x1 case, see block_1 test
-    a2_evaluated = a2;
-    for(int i = 0; i < a1.size(); ++i)
-      if(a1.coeff(i) != a2_evaluated.coeff(i)) return false;
-    return true;
-  }
-};
-
-template<typename Derived1, typename Derived2>
-struct test_is_equal_impl<Derived1, Derived2, false>
-{
-  static bool run(const Derived1& a1, const Derived2& a2)
-  {
-    if(a1.size() == 0 && a2.size() == 0) return true;
-    if(a1.rows() != a2.rows()) return false;
-    if(a1.cols() != a2.cols()) return false;
-    for(int j = 0; j < a1.cols(); ++j)
-      for(int i = 0; i < a1.rows(); ++i)
-        if(a1.coeff(i,j) != a2.coeff(i,j)) return false;
-    return true;
-  }
-};
-
-template<typename Derived1, typename Derived2>
-bool test_is_equal(const Derived1& a1, const Derived2& a2)
-{
-  return test_is_equal_impl<Derived1, Derived2>::run(a1, a2);
-}
-
-bool test_is_equal(const int actual, const int expected)
+template<typename T, typename U>
+bool test_is_equal(T actual, U expected)
 {
     if (actual==expected)
         return true;
