NetBSD compatibility fixes