fixed bug where first key was being skipped in SpatialIndex.