Fix connection bug in collector.
Merge branch 'ossec' into mobme_production

Bug fixes.