fix entity references and trademark formatting