Handle null sublists when flattening.