Fixed Tests and Tile Flag calculation