Added more descriptive error message for invalid IP addresses.