Made the TileLayer toXML method check if cell exists before exporting it.
Map removeTileSetAt method now only tries to remove from TileLayers.