Fix build on NetBSD, fix #23