Fixes a bug where sometimes (especiall in very large windows) tiles could be connected as neighbors to 'random' other tiles in the same sector with large indices.