fix application of patches for BSD. This should fix #414