Fix for FreeBSD. Closes issue #566.