Fixing wrong evaluation of max/min lat/long