Applying Zao's patch for FreeBSD