Fix bug in haversine distance calculator.