Added better error handling to the spatial intersect.