Correctly deal with multiple classes.