Fixed error statements in MapModel

When the size of the map is lengthX, the maximum tile coordinate in the
x direction is lengthX - 1.