Fix for almost infinite loop in "Insert intermediate Corners " code
Merge pull request #512 from ifad-ts/topic-cornerfix

Fix for almost infinite loop in "Insert intermediate Corners " code