SpatialSort size_t updates.
Various size_t updates and const correctness fixes.