Sort the array in place so single class cascades from ancestors work

This is a fix for the single class cascade I mentioned. Looking into the list bug now.