Shapefile export plus minor fixes