Fixed issue when exporting to shp a layer with long fields (>10 chars)

fixes #823