Refinements to tilemap segment logic.