Fixed a small bug with the calculation of the location