Made shapefile import more robust