Minor changes to allow compilation under FreeBSD