Correctly handle array of odd length.