Remove unnecessary flattening.