Bring in some changes from FreeBSD: