made it freebsd compat and fixed some issues with parameters