Fix connection bug in collector.