Better fix for flipped triangles.

Thanks to @espinielli for the suggestion!