Fixed bug in removing a connection.