Fixes for OpenBSD system.

I think that in NetBSD should be similar, but I don't have any machine
to test it.