Use flatten to normalize array.