Better handling of equivalent classes.