Added better support for FreeBSD and OpenIndiana