Fixes bug with nil connections
Implements connections count