Fixed a bug with sorter.