Cleanup connection.connect and remove debug output
Some crazy ugly mess [skip ci]