FreeBSD fixes

Fixes required to build openspades on FreeBSD. Useful for other systems as well.