diff --git a/src/transforms/bin.js b/src/transforms/bin.js
index ea84b234ba..a63358fa56 100644
--- a/src/transforms/bin.js
+++ b/src/transforms/bin.js
@@ -184,9 +184,9 @@ function binn(
groupFacet.push(i++);
groupData.push(reduceData.reduceIndex(b, data, extent));
if (K) GK.push(k);
- if (Z) GZ.push(G === Z ? f : Z[b[0]]);
- if (F) GF.push(G === F ? f : F[b[0]]);
- if (S) GS.push(G === S ? f : S[b[0]]);
+ if (Z) GZ.push(G === Z ? f : Z[(b.length > 0 ? b : g)[0]]);
+ if (F) GF.push(G === F ? f : F[(b.length > 0 ? b : g)[0]]);
+ if (S) GS.push(G === S ? f : S[(b.length > 0 ? b : g)[0]]);
if (BX1) BX1.push(extent.x1), BX2.push(extent.x2);
if (BY1) BY1.push(extent.y1), BY2.push(extent.y2);
for (const o of outputs) o.reduce(b, extent);
diff --git a/test/output/binFillFirstEmpty.html b/test/output/binFillFirstEmpty.html
new file mode 100644
index 0000000000..754c41ec5a
--- /dev/null
+++ b/test/output/binFillFirstEmpty.html
@@ -0,0 +1,183 @@
+
+
+ FEMALEMALEnull
+
+
\ No newline at end of file
diff --git a/test/output/integerIntervalArea.html b/test/output/integerIntervalArea.html
new file mode 100644
index 0000000000..45b07a8896
--- /dev/null
+++ b/test/output/integerIntervalArea.html
@@ -0,0 +1,105 @@
+
+
+ ab
+
+
\ No newline at end of file
diff --git a/test/output/integerIntervalAreaZ.html b/test/output/integerIntervalAreaZ.html
new file mode 100644
index 0000000000..773955f37c
--- /dev/null
+++ b/test/output/integerIntervalAreaZ.html
@@ -0,0 +1,100 @@
+
+