Fix failure in get connections.

Get connections function destroys some connections.