Fix BSD compatibility issue.