Added more debugging prints. Simplified TileLayer constructor.