Corrected navigation to do not step over the map margins;