Fix DitaWriter bugs