Fixed various FreeBSD10 issues.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194457