FreeBSD-specific fix
Merge pull request #542 from gahr/master

FreeBSD-specific fix (by gahr)