Various fixes to geocode.py, last commit being untested.