Fixed logic in hasNKinds