Convert IP to string before comparing to avoid unicode issues.