Workaround and hacks for FreeBSD