Fix some bugs on OpenBSD