Addresses portability issues with MacOSX and FreeBSD.