Added flattening.