metadata.php: Domain name checker fix
core.php: Improve core replacing routine