Order points by y coordinate. Fixes #1145