Fix a bug in remote login detection.