Fix optimization of flat arrays.