Bug fixes for location