Fixing some annoying bugs with the location