Smarter handling of the sweep_corner() from a diagonal to a cardinal. Fixes #26