Fixed cropcontours function so that cropped contour ends won't string together