Added out of bounds handling for getTile.