Compile fixes for FreeBSD

Some small changes.