             case "Z", "z":
                 if self.last is SDPath.Move {
                     self.removeLast()
-                } else if self.count != 0 {
+                } else if self.count != 0 && !(self.last is SDPath.ClosePath) {
                     let close = SDPath.ClosePath()
                     relative = start
                     lastcontrol = start

                    self.append(line)
                } while g.next() != nil && !commandsymbol.contains(g.current.utf8.first!)
            case "C":
                repeat {
                    let bezier = SDPath.CubicBezier(
                        x1: try toDouble(g.current), y1: try toDouble(g.next()),

                    self.append(bezier)
                } while g.next() != nil && !commandsymbol.contains(g.current.utf8.first!)
            case "T":
                if self.count == 0 || self.last is SDPath.ClosePath {
                    let move = SDPath.Move(start)
                    relative = move.point
                    lastcontrol = move.point
                    lastbezier = 0
                    self.append(move)
                }
                repeat {
                    let bezier: SDPath.QuadBezier
                    if lastbezier == 1 {
