diff --git a/configure.ac b/configure.ac
index d7adefe3a41c81a57cf430b2442a065fff2cb9ae..ef9051fbb35f1ee0ea5addd6e914fd1033a16aed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -861,6 +861,12 @@ AC_CONFIG_FILES([tests/testParser.sh], [chmod +x tests/testParser.sh])
 # Save the compilation options
 AC_DEFINE_UNQUOTED([SWIFT_CONFIG_FLAGS],["$swift_config_flags"],[Flags passed to configure])
 
+# Make sure the latest git revision string gets included
+touch src/version.c
+
+# Generate output.
+AC_OUTPUT
+
 # Report general configuration.
 AC_MSG_RESULT([
    Compiler        : $CC
@@ -894,9 +900,3 @@ AC_MSG_RESULT([
    Debugging checks  : $enable_debugging_checks
    Gravity checks    : $gravity_force_checks
 ])
-
-# Make sure the latest git revision string gets included
-touch src/version.c
-
-# Generate output.
-AC_OUTPUT
diff --git a/tests/difffloat.py b/tests/difffloat.py
index 8c8713a8d2968005a86a9c1e7fdce34bf3e624f7..ddcf7bcb29758afa3429dea8bcf50e1c5c0477dc 100644
--- a/tests/difffloat.py
+++ b/tests/difffloat.py
@@ -42,11 +42,6 @@ if len(sys.argv) >= 4:
 if len(sys.argv) >= 5:
     number_to_check = int(sys.argv[4])
 
-if len(sys.argv) == 6:
-    ignoreSmallRhoDh = int(sys.argv[5])
-else:
-    ignoreSmallRhoDh = 0
-
 # Get the particle properties being compared from the header.
 with open(file1, 'r') as f:
   line = f.readline()
@@ -69,7 +64,7 @@ n_lines = shape(data1)[0]
 n_columns = shape(data1)[1]
 
 if fileTol != "":
-    if n_linesTol != 2:
+    if n_linesTol != 3:
         print "Incorrect number of lines in tolerance file '%s'."%fileTol
     if n_columnsTol != n_columns:
         print "Incorrect number of columns in tolerance file '%s'."%fileTol
@@ -79,10 +74,12 @@ if fileTol == "":
     print "Relative difference tolerance:", rel_tol
     absTol = ones(n_columns) * abs_tol
     relTol = ones(n_columns) * rel_tol
+    limTol = zeros(n_columns)
 else:
     print "Tolerances read from file"
     absTol = dataTol[0,:]
     relTol = dataTol[1,:]
+    limTol = dataTol[2,:]
 
 n_lines_to_check = 0
 if number_to_check > 0:
@@ -113,11 +110,8 @@ for i in range(n_lines_to_check):
             print ""
             error = True
 
-        if abs(data1[i,j]) < 4e-6 and abs(data2[i,j]) < 4e-6 : continue
+        if abs(data1[i,j]) + abs(data2[i,j]) < limTol[j] : continue
 
-        # Ignore pathological cases with rho_dh
-        if ignoreSmallRhoDh and j == 8 and abs(data1[i,j]) < 2e-4: continue
-        
         if( rel_diff > 1.1*relTol[j]):
             print "Relative difference larger than tolerance (%e) for particle %d, column %s:"%(relTol[j], data1[i,0], part_props[j])
             print "%10s:           a = %e"%("File 1", data1[i,j])
diff --git a/tests/testPeriodicBC.c b/tests/testPeriodicBC.c
index c20f01bc44c3f8978ef818f477378f0edddd26fa..23ba1f50e77e0f56e473f1ac7de99b87a9a47336 100644
--- a/tests/testPeriodicBC.c
+++ b/tests/testPeriodicBC.c
@@ -34,7 +34,7 @@
 
 #if defined(WITH_VECTORIZATION)
 #define DOSELF1 runner_doself1_density_vec
-#define DOPAIR1 runner_dopair1_density_vec
+#define DOPAIR1 runner_dopair1_branch_density
 #define DOSELF1_NAME "runner_doself1_density_vec"
 #define DOPAIR1_NAME "runner_dopair1_density_vec"
 #endif
@@ -277,9 +277,8 @@ int check_results(struct part *serial_parts, struct part *vec_parts, int count,
 /* Just a forward declaration... */
 void runner_doself1_density(struct runner *r, struct cell *ci);
 void runner_doself1_density_vec(struct runner *r, struct cell *ci);
-void runner_dopair1_density(struct runner *r, struct cell *ci, struct cell *cj);
-void runner_dopair1_density_vec(struct runner *r, struct cell *ci,
-                                struct cell *cj);
+void runner_dopair1_branch_density(struct runner *r, struct cell *ci,
+                                   struct cell *cj);
 
 void test_boundary_conditions(struct cell **cells, struct runner runner,
                               const int loc_i, const int loc_j, const int loc_k,
diff --git a/tests/tolerance_periodic_BC_normal.dat b/tests/tolerance_periodic_BC_normal.dat
index 31ee002bb9c73ff8d74cce545aff715476b33507..f3fbdd2e3ad84639075d2259d856976c0ed9afc7 100644
--- a/tests/tolerance_periodic_BC_normal.dat
+++ b/tests/tolerance_periodic_BC_normal.dat
@@ -1,3 +1,4 @@
 #   ID      pos_x      pos_y      pos_z        v_x        v_y        v_z           rho        rho_dh        wcount     wcount_dh         div_v       curl_vx       curl_vy       curl_vz
-    0	    1e-6       1e-6	  1e-6 	       1e-6 	  1e-6	     1e-6	   2e-6	      4e-5	    2e-4       2e-3		 1e-5	     6e-6	   6e-6		 6e-6
-    0	    1e-6       1e-6	  1e-6 	       1e-6 	  1e-6	     1e-6	   1e-6	      1.2e-4	    1e-4       1e-4		 2e-4	     1e-4	   1e-4	 	 1e-4
+    0	    1e-6       1e-6	  1e-6 	       1e-6 	  1e-6	     1e-6	   3e-6	      4e-5	    2e-4       3e-3		 2e-4	     1e-4	   1e-4		 1e-4
+    0	    1e-6       1e-6	  1e-6 	       1e-6 	  1e-6	     1e-6	   2e-6	      1.2e-4	    1e-4       1e-4		 2e-4	     5e-4	   5e-4	 	 5e-4
+    0	    1e-6       1e-6	  1e-6 	       1e-6 	  1e-6	     1e-6	   1e-6	      1e-4	    1e-6       1e-4		 1e-4	     1e-4	   1e-4	 	 1e-4
diff --git a/tests/tolerance_periodic_BC_perturbed.dat b/tests/tolerance_periodic_BC_perturbed.dat
new file mode 100644
index 0000000000000000000000000000000000000000..fe3b47b24426abf99c02c97788e4efc8b567edc4
--- /dev/null
+++ b/tests/tolerance_periodic_BC_perturbed.dat
@@ -0,0 +1,4 @@
+#   ID      pos_x      pos_y      pos_z        v_x        v_y        v_z           rho        rho_dh        wcount     wcount_dh         div_v       curl_vx       curl_vy       curl_vz
+    0	    1e-6       1e-6	  1e-6 	       1e-6 	  1e-6	     1e-6	   3e-6	      4e-5	    2e-4       3e-3		 2e-4	     1e-4	   1e-4		 1e-4
+    0	    1e-6       1e-6	  1e-6 	       1e-6 	  1e-6	     1e-6	   2e-6	      3e-3	    1e-4       1e-4		 2e-3	     6e-3	   6e-3	 	 6e-3
+    0	    1e-6       1e-6	  1e-6 	       1e-6 	  1e-6	     1e-6	   1e-6	      1e-3	    1e-6       1e-4		 1e-4	     1e-4	   1e-4	 	 1e-4