Fixed TomDoc conversion