Fix bug with "remote_ip" WHERE query