Fixed connection issues in FreeBSD