Not completely there yet. I have to investigate why some holes aren't cleared:
OK, got an explanation, my detection of enclosure isn't accurate enough, I work on polygon as defined by the path anchors. Some anchors are very far away from each other, and the straight line between them cuts the polygon of some inner stroke, so the stroke aren't considered nested. I'll have to add a few anchors to improve accuracy (Gimp also has a path interpolation function that could be even easier...).