bugfixes in general and for freebsd