BSD fixes