Bugfixes to make this run on OpenBSD.