Rewrote init_connections() to be blocking.