fix tile id computation