Added support for location history and some minor improvements.