Fixed an issue where some items were not being sorted.