                     self.append(bezier)
                 } while g.next() != nil && !commandsymbol.contains(g.current.utf8.first!)
             case "s":
+                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.CubicBezier
                     if lastbezier == 2 {

                    self.appendContentsOf(arc)
                } while g.next() != nil && !commandsymbol.contains(g.current.utf8.first!)
            case "a":
                repeat {
                    let rx = try toDouble(g.current)
                    let ry = try toDouble(g.next())

                    self.append(line)
                } while g.next() != nil && !commandsymbol.contains(g.current.utf8.first!)
            case "V":
                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 line = SDPath.Line(x: relative.x, y: try toDouble(g.current))
                    relative = line.point
