fix problems in tile.py