small fixes for location bug