Fix bug with bad reference to length of connections available