Fix a buffer overflow bug.
Fix a segfault when all clusters are thinned in a tile.