Added TilemapState, bugfixes