Fixed sort by most_items method