Fixed countConnect() method.