diff --git a/bob/bio/vein/tests/test.py b/bob/bio/vein/tests/test.py
index fb4c4e1951236cfb4cb20d59158237934805c99e..fd8bec356aa979893a65d7d9f064223580268019 100644
--- a/bob/bio/vein/tests/test.py
+++ b/bob/bio/vein/tests/test.py
@@ -140,7 +140,7 @@ def test_preprocessor():
   preproc_ref = bob.core.convert(bob.io.base.load(output_img_filename),
       numpy.uint8, (0,255), (0.0,1.0))
 
-  assert numpy.mean(numpy.abs(mask - mask_ref)) < 1e-2
+  assert numpy.mean(numpy.abs(mask ^ mask_ref)) < 1e-2
 
   # Very loose comparison!
   #preprocessor_utils.show_image(numpy.abs(preproc.astype('int16') - preproc_ref.astype('int16')).astype('uint8'))
@@ -707,4 +707,4 @@ def test_hamming_distance():
   model_3 = numpy.array([0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0])
   probe_3 = numpy.array([[0, 1, 1, 1, 0, 1], [0, 1, 1, 1, 0, 1]])
   score_half = HD.score(model_3, probe_3)
-  assert score_half == 0.5
\ No newline at end of file
+  assert score_half == 0.5