Fixed build issue on FreeBSD

Sorry ignore the last pull request. I closed it. I had to change 3 different places.