Fix compile on BSD systems
Merge pull request #644 from mneumann/fix-compile-bsd

Fix compile on BSD systems