Fixing OpenBSD compilation issues, similar to lapis issue #64

Not sure if build works on Linux now so this needs testing.