Fix bsd build