Fix bug with wrong html entities replacement