A few fixes

I haven't tested the sparc fix but the kFreeBSD fix has been tested in a virtual machine.