Fixed the flipping problem -- Indices were not being chosen correctly for corners.