Having a dark sense of humor linked to more intelligence, study finds