Remove stray lines and segments in the result