Fixed bug in calculating MIS values, removing infrequent items.