Small change in the intersection method of a polygon

- [x] add tests

Fixes  #7429