Fix some NetBSD issues