Remove FreeBSD macros, fix warnings