Correcting some bugs in FreeBSD