Fix HTML character replacement