Fix *BSD compile issues