shapely speedups, error fixes