Fix compare() for task names in selector handling.