minor cleanup and freebsd compile fix