Revert broken changes!
A few bug fixes and html entity parsing