Sexual selection favors harmful mating in hermaphrodites more than in gonochorists.