Fixed parsing for entities and <> chars