Entity and html attribute fixes