Better manage namespace prefix. Also write layer's title.