Updated config code to firewall against invalid addresses.