Fix duplex code for FreeBSD