Fix FreeBSD in a way that doesn't break other UNIX.
Merge pull request #2 from wathiede/freebsd

Fix FreeBSD in a way that doesn't break other UNIX.