diff --git a/build.sbt b/build.sbt
index 27e8fb539c2a957b33b4b0f11368d6f93d6fe4e0..b0423e0ad04fcc31a6949953e5f79250f0d68d95 100644
--- a/build.sbt
+++ b/build.sbt
@@ -30,13 +30,13 @@ libraryDependencies ++= Seq(
 
 Keys.fork in run := true
 
-Keys.fork in test := true
+Keys.fork in Test := true
 
-logBuffered in test := false
+logBuffered in Test := false
 
-testOptions in test += Tests.Argument("-oD")
+testOptions in Test += Tests.Argument("-oDF")
 
-javaOptions in test += "-Xss32M"
+javaOptions in Test += "-Xss32M"
 
 parallelExecution in test := false
 
diff --git a/src/main/scala/leon/utils/Positions.scala b/src/main/scala/leon/utils/Positions.scala
index f5241de64930a454991623c8f4b6330f17ae8530..c38d1ab53b4374460095a431bb5acf2c04e4e8af 100644
--- a/src/main/scala/leon/utils/Positions.scala
+++ b/src/main/scala/leon/utils/Positions.scala
@@ -19,7 +19,13 @@ abstract class Position extends Ordered[Position] {
         ld
       }
     } else {
-      0
+      if (this.file eq null) {
+        -1
+      } else if (that.file eq null) {
+        +1
+      } else {
+        this.file.getPath.compare(that.file.getPath)
+      }
     }
   }