Bugfixes for shapefile export

Fixes for #182 and #183