Fix spherical distance implementation.

There are two implementations, and I picked the wrong one. Also, allow a little
bit of error in the spherical error coordinate system determination.