Implement geolocation and fix some bugs.