@@ -309,10 +309,12 @@ Elm.Native.Array.make = function(elm) {
309309
310310 // Create new node.
311311 var newA = { ctor:"_Array", height:a.height
312− , table:a.table.slice(0, right + 1)
313− , lengths:a.lengths.slice(0, right + 1) };
314− newA.table[right] = sliced;
315− newA.lengths[right] = length(sliced) + (right > 0 ? newA.lengths[right - 1] : 0);
312+ , table:a.table.slice(0, right)
313+ , lengths:a.lengths.slice(0, right) };
314+ if (sliced.table.length > 0) {
315+ newA.table[right] = sliced;
316+ newA.lengths[right] = length(sliced) + (right > 0 ? newA.lengths[right - 1] : 0);
317+ }
316318 return newA;
317319 }
318320