Fix BSD build