freeBSD fixes added.