Fixed build on BSD