Fix compatibility issue with FreeBSD (Alexandre Raynaud, Jason Harris, #39)