Fixed issues with multiple connections.