Fixed bug with double added connection (reproduced in issue #48)