diff --git a/elki-clustering/src/main/java/elki/evaluation/clustering/Entropy.java b/elki-clustering/src/main/java/elki/evaluation/clustering/Entropy.java
index <HASH>..<HASH> 100644
--- a/elki-clustering/src/main/java/elki/evaluation/clustering/Entropy.java
+++ b/elki-clustering/src/main/java/elki/evaluation/clustering/Entropy.java
@@ -203,9 +203,9 @@ public class Entropy {
    */
   private void computeMIFull(int[][] contingency, int r, int c, int n, int m, double byn, double mlogn, double[] logs) {
     // Precompute log(factorial) table:
-    double[] lfacs = new double[n];
+    double[] lfacs = new double[Math.max(n, 1)];
     double tmp = 0.;
-    for(int i = 2, e = n - m; i <= e; i++) {
+    for(int i = 2, e = Math.max(n - m, 2); i <= e; i++) {
       lfacs[i - 2] = tmp += log(i, logs);
     }
     final int[] lastrow = contingency[r];
Fix potential corner case in Entropy when n=m