Correcting some bugs on NetBSD