Added tests for sorting.