tweaks to allow this to build on openbsd