Fix MacOSX and FreeBSD Support