Fix bug in proxy detection