Fix for BSD