Fix map boundaries check