Fixed selection of closed polylines, when the first and last point is included in the selection
Fixed a bug where the last undo action wasn't removed from the undo list