Recent attempts to import the contour-files output from the SVM module into QGIS failed due to geometry problems in the shapefiles produced by SVM. Problems were traced back to two sets of errors. First, some of the contours produced by the ContourBuilder had self-intersecting lines. Second, the API for writing shapefiles has some coding errors. This issue proposes to fix both these problems.