adjust limits better (from NetBSD)