two fixes for pathbuilder

no more duplicate pathsegments
beginpoint is now placed at the start point. Same goes for endpoint.