Invalid debug logs when failing to connect, close #699