Fix geo distance bug and improve geo distance tests.