Fix a few bugs in the openbsd script and add sanity checks.